1 2007-07-02 Simon Baldwin <simonb@google.com>
3 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
4 for inner-style nested forward declarations that don't declare
7 2007-07-02 Jakub Jelinek <jakub@redhat.com>
10 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
11 DECL_P in not a variable and appears more than once error messages.
13 2007-07-01 Ollie Wild <aaw@google.com>
15 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
16 (select_decl): Remove function.
17 (unqualified_namespace_lookup): Populate binding by calling
18 ambiguous_decl. Remove select_decl call.
19 (lookup_qualified_name): Remove select_decl call.
20 * decl.c (lookup_and_check_tag): Check for ambiguous references.
21 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
22 generation when name lookup is ambiguous.
24 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
27 * init.c (build_new_1): Use structural equality on the copy of the
30 2007-06-28 Geoffrey Keating <geoffk@apple.com>
32 * decl2.c (determine_visibility): Implement
33 flag_visibility_ms_compat effect on type info.
34 * decl.c (cxx_init_decl_processing): Implement
35 global effect of flag_visibility_ms_compat.
37 2007-06-28 Geoffrey Keating <geoffk@apple.com>
39 * decl2.c (start_objects): Mark constructor-running function
42 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
45 * decl.c (grokdeclarator): Reset friendp for member functions declared
46 friend of their own class.
48 2007-06-23 Mark Mitchell <mark@codesourcery.com>
50 * decl2.c (determine_visibility): Don't look for dllexport here.
51 (determine_visibility_from_class): Tidy.
53 2007-06-18 Simon Baldwin <simonb@google.com>
56 * parser.c (cp_parser_single_declaration): Added check for storage
57 class other than sc_none in parsed declaration, and a flag to indicate
58 if the call is part of an explicit template specialization parse.
59 * (cp_parser_explicit_specialization): Specialization check flag added
60 to call to cp_parser_single_declaration(), set true.
61 * (cp_parser_template_declaration_after_export): Specialization check
62 flag added to call to cp_parser_single_declaration(), set false.
63 * pt.c (check_explicit_specialization): Added code to copy visiblity
64 and linkage from the templated function to the explicit specialization.
66 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
68 * typeck.c (build_binary_op): For templates build the
69 expression in pieces to avoid the assert in build2_stat.
70 (get_member_function_from_ptrfunc):
71 Change over to using POINTER_PLUS_EXPR and convert
72 the second operand to sizetype.
73 * typeck2.c (build_m_component_ref): Likewise.
74 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
75 instead of PLUS_EXPR for pointers.
76 (build_new_1): Likewise.
77 (build_vec_delete_1): Likewise.
78 (build_vec_delete): Likewise.
79 * class.c (build_base_path): Likewise.
80 (build_base_path): Likewise.
81 (convert_to_base_statically): Likewise.
82 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
83 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
85 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
86 instead of PLUS_EXPR for pointers.
87 * call.c (build_special_member_call): Likewise.
88 * rtti.c (build_headof): Likewise.
89 Use sizetype instead of ptrdiff_type_node.
90 (tinfo_base_init): Create a POINTER_PLUS_EXPR
91 instead of PLUS_EXPR for pointers.
92 * except.c (expand_start_catch_block): Do a
93 NEGATIVE and then a POINTER_PLUS_EXPR instead
95 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
96 PLUS_EXPR on pointer types over to use
97 POINTER_PLUS_EXPR and remove the conversion
99 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
100 adding to a pointer type. Use size_int instead of
101 ssize_int. Convert the index to sizetype before
102 adding it to the pointer.
104 2007-06-15 Mark Mitchell <mark@codesourcery.com>
106 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
107 (DECL_ANON_UNION_VAR_P): New macro.
108 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
109 than DECL_VAR_MARKED_P, to keep track of which variables we have
111 * decl.c (redeclaration_error_message): Complain about redeclaring
112 anonymous union members at namespace scope.
113 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
115 2007-06-14 Geoff Keating <geoffk@apple.com>
117 * decl2.c (determine_visibility): Ensure that functions with
118 hidden types as parameters are hidden.
121 * decl2.c (determine_visibility): Remove duplicate code for
124 2007-06-12 Ian Lance Taylor <iant@google.com>
127 * init.c (avoid_placement_new_aliasing): New static function.
128 (build_new_1): Call it.
130 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
132 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
133 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
135 2007-06-08 Jakub Jelinek <jakub@redhat.com>
138 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
139 on init, the non-decl cond operand and increment value.
141 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
144 * decl.c (check_initializer): Report an error when a brace enclosed
145 initializer is used for a non-aggregate type in C++98.
146 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
148 (grokdeclarator): Likewise.
149 (move_fn_p): Likewise.
150 * typeck.c (check_return_expr): Likewise.
151 * call.c (reference_binding): Likewise.
152 * error.c (cp_cpp_error): Likewise.
153 * pt.c (check_default_tmpl_args): Likewise.
155 * lex.c (init_reswords): Likewise.
156 * parser.c (p_parser_primary_expression): Likewise.
157 (TOKEN_PRECEDENCE): Likewise.
158 (cp_parser_init_declarator): Likewise.
159 (cp_parser_ptr_operator): Likewise.
160 (cp_parser_parameter_declaration): Likewise.
161 (cp_parser_enclosed_template_argument_list): Likewise.
162 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
163 (cp_parser_next_token_ends_template_argument_p): Likewise.
165 2007-06-04 Simon Baldwin <simonb@google.com>
167 * decl.c (grokdeclarator): Readability change. Moved case labels
168 into direct switch statement scope.
170 2007-06-04 Paolo Carlini <pcarlini@suse.de>
172 * call.c (convert_like_real): Remove pointless code.
174 2007-05-31 Mark Mitchell <mark@codesourcery.com>
176 * decl.c (get_atexit_fn_ptr_type): New function.
177 (get_atexit_node): Use it.
178 (start_cleanup_fn): Likewise.
179 (register_dtor_fn): Use the object's destructor, instead of a
180 separate cleanup function, where possible.
181 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
182 (atexit_fn_ptr_type_node): New macro.
183 * decl2.c (build_cleanup): Use build_address.
185 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
187 * typeck.c (build_binary_op): Include types in error.
189 2007-05-31 Jakub Jelinek <jakub@redhat.com>
192 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
193 needs runtime initialization.
195 2007-05-31 Paolo Carlini <pcarlini@suse.de>
198 * semantics.c (finish_trait_expr): Complete the types.
200 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
201 Douglas Gregor <doug.gregor@gmail.com>
202 Pedro Lamarao <pedro.lamarao@mndfck.org>
203 Howard Hinnant <howard.hinnant@gmail.com>
207 * typeck.c (comptypes): Don't consider rvalue and lvalue
208 reference types to be equivalent.
209 (check_return_expr): Move from certain lvalues when returning
211 * decl.c (grokdeclarator): Implement reference collapsing.
212 (copy_fn_p): Don't consider constructors taking rvalue references
213 to be copy constructors.
215 * call.c (conversion): New "rvaluedness_matches_p" member.
216 (convert_class_to_reference): Require reference type as first
217 parameter instead of base type.
218 (reference_binding): Add logic to handle rvalue references.
219 (implicit_conversion): Update inaccurate comment.
220 (convert_like_real): Disable creation of temporaries that are
221 impossible to initialize for types with move constructors.
222 (build_over_call): Elide move constructors when possible.
223 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
224 (maybe_handle_ref_bind): Return conversion instead of type node.
225 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
226 determine preferred conversion sequences.
227 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
228 (LOOKUP_PREFER_RVALUE): New.
229 (DECL_MOVE_CONSTRUCTOR_P): New.
230 (struct cp_declarator): Add "reference" member for reference
231 types, with new "rvalue_ref" flag.
232 (cp_build_reference_type): Declare.
233 (move_fn_p): Declare.
234 * error.c (dump_type_prefix): Format rvalue reference types
235 correctly in error messages.
236 * except.c (build_throw): Move from certain lvalues when
238 * mangle.c (write_type): Mangle rvalue references differently
239 than regular references.
240 * parser.c (make_reference_declarator): Add boolean parameter for
242 (cp_parser_make_indirect_declarator): New.
243 (cp_parser_new_declarator_opt): Call
244 cp_parser_make_indirect_declarator.
245 (cp_parser_conversion_declarator_opt): Ditto.
246 (cp_parser_declarator): Ditto.
247 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
249 * pt.c (tsubst): Implement reference collapsing.
250 (maybe_adjust_types_for_deduction): Implement special template
251 parameter deduction rule for rvalue references.
252 (type_unification_real): Update calls to
253 maybe_adjust_types_for_deduction.
254 (try_one_overload): Ditto.
255 (unify_pack_expansion): Ditto.
256 * tree.c (lvalue_p_1): Handle rvalue reference types.
257 (cp_build_reference_type): New.
259 2007-05-30 Jakub Jelinek <jakub@redhat.com>
262 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
263 variables that need runtime initialization.
265 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
268 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
269 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
270 case POSTDECREMENT_EXPR>): Return the error_mark_node
271 if either the real or imaginary parts would an
274 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
275 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
278 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
279 token is a closing brace, false if there are no tokens left.
280 (cp_parser_namespace_alias_definition): Only consume the next token if
281 it is a closing brace.
283 * parser.c (cp_parser_class_specifier): Likewise.
285 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
287 * semantics.c (finish_member_declaration): Fix a typo in the
290 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
302 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
303 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
304 * pt.c (check_for_bare_parameter_packs): Return bool indicated
305 whether everything was okay. Fix indentation.
306 (push_template_decl_real): Check for bare parameter packs in
307 function parameters; where errors occur, mark the parameter types
308 with ERROR_MARK_NODEs to avert ICEs.
309 (coerce_template_parameter_pack): New.
310 (coerce_template_parms): Moved parameter pack coercion into
311 coerce_template_parameter_pack, and permit it anywhere in the
312 template parameter list (not just at the end). Parameter and
313 argument indices can vary (somewhat) separately now, so add
314 PARM_IDX and ARG_IDX.
315 (fn_type_unification): Don't set an argument pack as incomplete if
316 no argument pack was deduced.
317 (type_unification_real): If a type parameter is a parameter pack
318 and has not otherwise been deduced, it will be deduced to an empty
320 (more_specialized_fn): Use the actual lengths of the argument
321 lists when comparing against expansions.
322 * semantics.c (finish_member_declaration): If a field's type has
323 bare parameter packs, error and set its type to ERROR_MARK_NODE.
325 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
328 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
330 2007-05-22 Ollie Wild <aaw@google.com>
332 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
333 (unqualified_namespace_lookup): Adds check for hidden types.
335 2007-05-22 Ollie Wild <aaw@google.com>
337 * decl.c (duplicate_decls): Verify namespace names are unique.
339 2007-05-21 Mark Mitchell <mark@codesourcery.com>
341 * decl.c (cxx_maybe_build_cleanup): Handle
342 __attribute__((cleanup)).
344 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
346 * cvt.c (cp_convert_and_check): Don't check warnings if the
349 2007-05-18 Geoffrey Keating <geoffk@apple.com>
351 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
353 2007-05-14 Paolo Carlini <pcarlini@suse.de>
356 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
357 type only if is a class type (5.2.8/4).
359 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
361 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
362 * decl.c (grokdeclarator): Use unsigned_type_for instead of
363 c_common_unsigned_type.
365 2007-05-11 Silvius Rus <rus@google.com>
367 * cp/typeck.c (build_indirect_ref): Add call to
368 strict_aliasing_warning.
369 (build_reinterpret_cast_1): Condition call to
370 strict_aliasing_warning.
372 2007-05-11 Jan Hubicka <jh@suse.cz>
374 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
375 * decl2.c (start_objects): ctors and dtors are no longer public.
376 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
378 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
380 * typeck.c (build_unary_op): Remove code that used to
381 handle non lvalue increments/decrements.
383 2007-05-07 Mike Stump <mrs@apple.com>
385 * parser.c (check_empty_body): Add.
386 (cp_parser_iteration_statement): Add call to check_empty_body.
388 2007-05-05 Geoffrey Keating <geoffk@apple.com>
391 * mangle.c (write_mangled_name): Mangle static variable names.
392 (write_unqualified_name): Use local-source-name for
393 namespace-scope static variables.
395 2007-05-04 Dirk Mueller <dmueller@suse.de>
397 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
400 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
403 * decl2.c (constrain_class_visibility):
404 Use strip_pointer_or_array_types instead of strip_array_types.
406 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
409 * decl.c (reshape_init_r): Don't reshape the first element if it
410 is a pointer to member function.
412 2007-04-27 Simon Baldwin <simonb@google.com>
414 * decl.c (grokparms): Changed message format from %qD to %qE.
416 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
418 * error.c (maybe_warn_variadic_templates): Variadic templates are
419 now in C++0x, so only warn about them in C++98 mode.
421 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
424 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
425 integeral types from vectors types.
427 2007-04-26 Jakub Jelinek <jakub@redhat.com>
430 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
431 for type dependent OMP_CLAUSE_DECLs.
433 2007-04-24 Mark Mitchell <mark@codesourcery.com>
436 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
437 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
438 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
439 * init.c (build_zero_init): Adjust, as
440 COMPLEX_TYPE is now a SCALAR_TYPE.
441 * typeck2.c (digest_init): Allow brace-enclosed initializers for
442 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
444 2007-04-25 Paolo Carlini <pcarlini@suse.de>
446 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
447 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
448 (trait_expr_value): Adjust.
450 2007-04-23 Simon Baldwin <simonb@google.com>
452 * decl.c (grokparms): Added new error for duplicate function
453 parameters names in function prototypes, to match gcc behavior.
455 2007-04-23 Jan Hubicka <jh@suse.cz>
457 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
460 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
462 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
463 instead of checking GIMPLE_STMT_P in chain_next.
465 2007-04-17 Mark Mitchell <mark@codesourcery.com>
468 * call.c (convert_for_arg_passing): Convert bitfields to their
471 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
474 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
476 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
480 * cp/decl2.c (constrain_class_visibility):
481 Do not warn about the use of anonymous namespace in the main input file.
483 2007-04-15 Mark Mitchell <mark@codesourcery.com>
485 * cp-tree.h (current_template_parms): Fix typo in comment.
487 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
489 * cp-tree.h, error.c: Fix comment typos.
491 2007-04-13 Jason Merrill <jason@redhat.com>
494 * call.c (reference_binding): Add c_cast_p parm. If true,
495 add quals to TO as needed to make it reference-compatible.
497 2007-04-11 Jan Hubicka <jh@suse.cz>
499 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
500 that we are not processing template_decl.
502 2007-04-09 Mark Mitchell <mark@codesourcery.com>
505 * class.c (build_base_path): Ensure that the converted pointer has
506 the same cv-qualification as the input.
508 2007-04-09 Paolo Carlini <pcarlini@suse.de>
510 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
512 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
514 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
516 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
517 * tree.c (cp_add_pending_fn_decls): Remove.
518 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
520 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
522 Revert change removing staticp.
524 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
526 * cp-objcp-common.c (cxx_staticp): Remove.
527 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
528 * cp-tree.h (cxx_staticp):
530 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
532 * class.c (check_for_override): Don't remove dllmport attribute
535 2007-04-03 Jakub Jelinek <jakub@redhat.com>
538 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
539 type issue error and return early.
541 2007-03-30 Jason Merrill <jason@redhat.com>
544 * typeck.c (cp_type_readonly): New fn.
545 * cp-tree.h: Declare it.
546 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
547 (cp_finish_decl): Not here.
549 2007-03-31 Richard Guenther <rguenther@suse.de>
551 * optimize.c (maybe_clone_body): Replace splay-tree usage by
554 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
559 * parser.c (declarator_can_be_parameter_pack): New.
560 (cp_parser_template_parameter): Only parse the `...' if the
561 declarator can be a parameter pack.
562 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
564 * pt.c (find_parameter_packs_r): Look into the bounds on integer
565 types (they could be used as array bounds).
566 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
567 (tsubst_pack_expansion): Handle failure to expand parameter
570 2007-03-30 Paolo Carlini <pcarlini@suse.de>
573 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
574 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
575 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
576 (CLASS_TYPE_NON_UNION_P): Add.
577 (struct lang_type_class): Add has_complex_dflt.
578 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
579 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
580 * cp-tree.def: Add TRAIT_EXPR.
581 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
582 * lex.c (struct resword): Add __has_nothrow_assign,
583 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
584 __has_trivial_constructor, __has_trivial_copy,
585 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
586 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
587 __is_pod, __is_polymorphic, __is_union.
588 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
589 (cp_parser_trait_expr): New.
590 * semantics.c (finish_trait_expr, trait_expr_value
591 classtype_has_nothrow_copy_or_assign_p): New.
592 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
594 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
595 * class.c (check_bases, check_field_decl, check_bases_and_members):
596 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
597 * pt.c (uses_template_parms, tsubst_copy_and_build,
598 value_dependent_expression_p, type_dependent_expression_p): Deal with
600 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
602 2007-03-29 Richard Guenther <rguenther@suse.de>
604 * tree.c (cp_walk_subtrees): Do not set input_location.
606 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
609 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
612 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
614 * parser.c (struct cp_parser): Update comment for
615 greater_than_is_operator_p.
616 (cp_parser_primary_expression): In C++0x mode, a cast operator can
617 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
618 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
619 !GREATER_THAN_IS_OPERATOR_P.
620 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
621 `>>' operators that will become two `>' tokens in C++0x.
622 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
623 mode, allowing it to terminate default arguments.
624 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
625 `>>' like two consecutive `>' tokens.
626 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
627 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
628 ends a template argument.
630 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
632 * decl.c (redeclaration_error_message): Complain when redeclaring
633 a friend function with default template arguments (C++0x mode only).
634 * cp-tree.h (check_default_tmpl_args): Declare.
635 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
636 template arguments in function templates. Add support for checking
637 the default template arguments of friend templates.
638 (push_template_decl_real): Fix call to check_default_tmpl_args.
639 (type_unification_real): If a template parameter has not been
640 deduced but provides a default template argument, substitute into
641 that default template argument.
642 * parser.c (cp_parser_init_declarator): When declaring (but not
643 defining!) a function template in C++0x mode, check for default
646 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
649 * decl.c (grokdeclarator): Deal with cv-qualified function type
650 typedefs in the same way for member and non-member functions.
652 2007-03-26 Dirk Mueller <dmueller@suse.de>
654 * parser.c (cp_parser_member_declaration): Pedwarn
655 about stray semicolons after member declarations.
657 2007-03-26 Paolo Carlini <pcarlini@suse.de>
660 * pt.c (instantiate_decl): Set in_system_header.
662 2007-03-22 Mark Mitchell <mark@codesourcery.com>
664 * cp-tree.h (current_tempalte_parms): Improve documentation.
665 * pt.c (current_template_args): Likewise.
668 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
669 not consume tokens when failing.
671 2007-03-22 Jim Wilson <wilson@specifix.com>
672 Mark Mitchell <mark@codesourcery.com>
675 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
676 consistent with FROM.
678 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
680 * error.c (dump_expr): Handle dependent names that designate types.
681 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
683 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
685 * cp-tree.def, parser.c, pt.c: Fix comment typos.
687 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
689 * cvt.c (cp_convert_and_check) : Define.
690 * cp-tree.h (cp_convert_and_check): Declare.
691 * call.c (convert_conversion_warnings): Rename to
692 conversion_null_warnings. The warning for floating-point to
693 integer is handled by convert_and_check in convert_like_real.
694 (convert_like_real): convert_conversion_warnings was renamed as
695 conversion_null_warnings.
696 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
697 overflow and changes of value during conversion.
699 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
702 * parser.c (cp_parser_statement): If 'namespace' is found, this
703 only can be a namespace alias definition, so parse it now.
704 (cp_parser_namespace_alias_definition): if we find an open brace
705 instead of '=', then this is actually a misplaced namespace
708 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
711 * decl.c (cxx_init_decl_processing): Move command-line options
712 processing to c-opts.c.
714 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
716 * ptree.c (cxx_print_type): Use formatting markup for integers
717 when printing template parameter index/level/orig level.
718 (cxx_print_xnode): Ditto.
719 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
720 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
721 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
723 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
724 rather than a HOST_WIDE_INT.
725 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
726 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
728 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
729 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
730 IN_BASE_INITIALIZER bool bitfields.
731 (struct cp_declarator): Make KIND a 4-bit field. Make
732 PARAMETER_PACK_P a bool bitfield just after KIND.
733 * pt.c (uses_parameter_packs): Destroy the pointer set.
734 (make_pack_expansion): Ditto.
735 (check_for_bare_parameter_packs): Ditto.
736 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
738 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
741 * call.c (convert_default_arg): Instead of copying the node,
744 2007-03-15 Dirk Mueller <dmueller@suse.de>
747 * call.c (convert_conversion_warnings): New..
748 (convert_like_real): .. factored out from here.
749 (convert_conversion_warnings): Add warning about
750 false being converted to NULL in argument passing.
752 2007-03-14 Dirk Mueller <dmueller@suse.de>
754 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
755 (finish_do_body): Warn about empty body in do/while statement.
757 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
759 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
761 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
764 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
767 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
769 * cp/repo.c (init_repo): Initialize random_seed saved options.
770 (finish_repo): Adjust.
772 2007-03-13 Mark Mitchell <mark@codesourcery.com>
775 * Make-lang.in (doc/g++.1): Use $< to specify the location from
778 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
780 * decl.c (compute_array_index_type): New warning flag warn_vla.
782 2007-03-12 Mark Mitchell <mark@codesourcery.com>
785 * call.c (convert_default_arg): Copy non-constant arguments.
787 2007-03-11 Mark Mitchell <mark@codesourcery.com>
790 * parser.c (cp_parser_postfix_expression): Disallow compound
791 literals in constant expressions.
794 * semantics.c (finish_typeof): Use unlowered_expr_type.
796 2007-03-10 Mark Mitchell <mark@codesourcery.com>
799 * cp-tree.h (unlowered_expr_type): New function.
800 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
801 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
802 (unlowered_expr_type): New function.
803 (build_unary_op): Disallow predecrements of bool bitfields.
804 * call.c (build_conditional_expr): Use unlowered_expr_type.
805 * pt.c (type_unification_real): Likewise.
807 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
810 * typeck.c (check_return_expr): Check for bare parameter packs.
811 (comptypes): Compare template parameter packs and
812 type pack expansions.
813 * decl.c (grokdeclarator): Deal with the declaration of function
815 (grokparms): Verify that the (optional) function parameter pack is
816 at the end of the parameter list.
817 (xref_basetypes): Handle pack expansions in the base class.
818 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
819 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
820 (NONTYPE_ARGUMENT_PACK): New.
821 (TYPE_PACK_EXPANSION): New.
822 (EXPR_PACK_EXPANSION): New.
823 (ARGUMENT_PACK_SELECT): New.
824 * cp-objcp-common.c (cp_tree_size): Compute size of
825 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
826 ARGUMENT_PACK_SELECT.
827 * error.c (dump_template_argument): Print template argument packs.
828 (dump_template_argument_list): Ditto.
829 (dump_template_parameter): Dump `...' for template type parameter
831 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
832 (dump_parameters): Print function parameter packs.
833 (dump_template_parms): Print template argument packs.
834 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
835 (maybe_warn_variadic_templates): New.
836 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
837 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
838 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
840 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
841 (write_template_arg): Write argument packs as separate arguments.
842 * cp-tree.h (struct template_parm_index_s): Add flag that
843 indicates that the template parameter is actually a parameter
845 (struct tree_argument_pack_select): New.
846 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
847 (union lang_tree_node): Add argument_pack_select.
848 (FUNCTION_PARAMETER_PACK_P): New.
849 (PACK_EXPANSION_P): New.
850 (PACK_EXPANSION_PATTERN): New.
851 (SET_PACK_EXPANSION_PATTERN): New.
852 (PACK_EXPANSION_PARAMETER_PACKS): New.
853 (ARGUMENT_PACK_P): New.
854 (ARGUMENT_PACK_ARGS): New.
855 (SET_ARGUMENT_PACK_ARGS): New.
856 (ARGUMENT_PACK_INCOMPLETE_P): New.
857 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
858 (TEMPLATE_PARM_PARAMETER_PACK): New.
859 (TEMPLATE_TYPE_PARAMETER_PACK): New.
860 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
861 (ARGUMENT_PACK_SELECT_INDEX): New.
862 (ARGUMENT_PACK_SELECT_ARG): New.
863 (struct cp_declarator): Add parameter_pack_p flag.
864 (maybe_warn_variadic_templates): Declare.
865 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
866 indicate a template parameter pack.
867 (uses_parameter_packs): Declare.
868 (template_parameter_pack_p): Declare.
869 (template_parms_variadic_p): Declare.
870 (make_pack_expansion): Declare.
871 (check_for_bare_parameter_packs): Declare.
872 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
873 sizeof... expressions.
874 (pp_cxx_expression): Print pack expansions and non-type argument
876 (pp_cxx_exception_specification): Print pack expansions.
877 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
878 (pp_cxx_ctor_initializer): Print pack expansions.
879 (pp_cxx_type_id): Print pack expansions.
880 (pp_cxx_template_argument_list): Print argument packs.
881 (pp_cxx_template_parameter): Print ellipsis for template parameter
883 * pt.c (comp_template_parms): Compare template parameter packs.
884 (template_parameter_pack_p): New.
885 (template_parms_variadic_p): New.
886 (template_args_variadic_p): New.
887 (make_ith_pack_parameter_name): New.
888 (struct find_parameter_pack_data): New.
889 (find_parameter_packs_r): New.
890 (uses_parameter_packs): New.
891 (make_pack_expansion): New.
892 (check_for_bare_parameter_packs): New.
893 (expand_template_argument_pack): New.
894 (reduce_template_parm_level): Propagate parameter pack flag.
895 (process_template_parm): Add is_parameter_pack parameter to state
896 when the parameter is actually a parameter pack. Create template
897 parameter packs when is_parameter_pack is true.
898 (current_template_args): The argument for a template parameter
899 pack is an argument pack containing a single pack expansion.
900 (process_partial_specialization): When checking that non-type
901 argument expressions do not involve template parameters, loop over
902 the arguments in argument packs separately.
903 (push_template_decl_real): Check that the type of the declaration
904 does not have any bare parameter packs. Check that primary
905 templates have no more than one parameter pack, and that it comes
906 at the end of the template parameter list.
907 (convert_template_argument): Handle coercions for pack expansion
908 expressions by coercing the pattern then rebuilding the expansion.
909 (coerce_template_parms): When coercing the arguments for a
910 variadic template, pack "extra" arguments into an argument pack.
911 (coerce_template_template_parms): Cannot coerce between parameter
912 packs and non-pack parameters.
913 (template_args_equal): Compare PACK_EXPANSION_P expressions.
914 (comp_template_args): Expand all template arguments packs before
915 comparing template argument lists.
916 (mangle_class_name_for_template): Make argument packs as separate
918 (for_each_template_parm_r): No need to handle BASELINK.
919 (instantiate_class_template): Handle pack expansions in the base
921 (tsubst_pack_expansion): New.
922 (tsubst_template_args): Handle substitutions of argument packs and
923 pack expansion into template argument lists.
924 (tsubst_decl): Expand function parameter packs into separate
926 (tsubst_arg_types): Expand a type pack expansion into separate
928 (tsubst_exception_specification): Handle pack expansions in
929 exception specifiers.
930 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
931 replacing a template parameter with its argument. If we encounter
932 a substitution for an argument pack, just return the parameter
934 (tsubst_copy): sizeof(X...) returns the number of elements in
935 parameter pack X. See through ARGUMENT_PACK_SELECT when the
936 PARM_DECL is a parameter pack.
937 (tsubst_expr): Expression pack expansions and argument packs
938 cannot show up here; they will all be handled through function
939 calls, sizeof, and template argument lists.
940 (tsubst_copy_and_build): sizeof(X...) returns the number of
941 elements in parameter pack X. Handle pack expansions in TREE_LIST
942 and CONSTRUCTOR nodes.
943 (fn_type_unification): Handle "incomplete" explicit template
944 argument lists that specify some of the arguments for a template
946 (type_unification_real): Unify arguments against pack expansions.
947 (template_parm_level_and_index): New, helper function.
948 (unify_pack_expansion): New.
949 (unify): Unify argument packs on an argument-by-argument basis,
950 handling variadic argument packs as well.
951 (more_specialized_fn): Handle unification of function parameter
952 packs. All things being equal, prefer non-variadic function
953 templates to variadic function templates.
954 (more_specialized_class): Prefer the variadic class template
955 partial specialization that binds fewer arguments to a parameter
957 (regenerate_decl_from_template): Expand function parameter packs
958 into separate parameters.
959 (instantiate_decl): Ditto.
960 (tsubst_initializer_list): Handle pack expansions for base-class
962 (dependent_type_p_r): Determine dependent types in argument packs
964 (value_dependent_expression_p): Determine value-dependence of
965 non-type argument packs.
966 (dependent_template_arg_p): Handle argument packs.
967 * semantics.c (finish_cond): Check for bare parameter packs.
968 (finish_expr_stmt): Ditto.
969 (finish_for_expr): Ditto.
970 (finish_switch_cond): Ditto.
971 (finish_mem_initializers): Ditto.
972 * name-lookup.c (arg_assoc_type): Handle pack expansions and
974 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
975 * parser.c (make_declarator): Declarator is not an expansion.
976 (make_pointer_declarator): Transfer parameter pack flag to outer
978 (make_reference_declarator): Ditto.
979 (make_ptrmem_declarator): Ditto.
980 (make_call_declarator): Ditto.
981 (make_array_declarator): Ditto.
982 (cp_parser_postfix_expression): Allow pack expansion expressions
983 in the argument list for a call expression.
984 (cp_parser_parenthesized_expression_list): Add new parameter
985 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
986 into separate arguments."
987 (cp_parser_new_placement): Allow pack expansion expressions.
988 (cp_parser_new_initializer): Ditto.
989 (cp_parser_mem_initializer_list): Allow ellipsis to create a
990 base-class initializer expansion.
991 (cp_parser_mem_initializer): Ditto.
992 (cp_parser_template_parameter_list): Keep track of whether the
993 template parameter is a template parameter pack.
994 (cp_parser_template_parameter): Parse the ellipsis to indicate a
995 template parameter pack.
996 (cp_parser_type_parameter): Ditto.
997 (cp_parser_template_argument_list): Parse the ellipsis to indicate
999 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1000 this declarator is a parameter pack.
1001 (cp_parser_parameter_declaration): The ellipsis does not end the
1002 parameter declaration, because it might be a parameter pack. Parse
1003 the ellipsis to indicate a parameter pack.
1004 (cp_parser_initializer): Allow pack expansions.
1005 (cp_parser_initializer_list): Allow ellipsis to create an
1006 initializer expansion.
1007 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1009 (cp_parser_type_id_list): Allow ellipsis to create an exception
1010 specifier expansion.
1011 (cp_parser_attribute_list): Don't allow pack expansions.
1012 (cp_parser_functional_cast): Allow pack expansions.
1013 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1014 compute the length of a parameter pack.
1015 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1016 end a template argument.
1017 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1018 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1021 2007-03-09 Dirk Mueller <dmueller@suse.de>
1023 * cp/call.c (build_new_op): Call warn_logical_operator.
1025 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1028 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1031 * pt.c (any_template_arguments_need_structural_equality_p):
1034 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1036 * decl.c (grokdeclarator): Disable warnings for anonymous
1039 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1041 * typeck2.c (readonly_error): Always emit a hard error.
1042 Remove last argument.
1043 * cp-tree.h (readonly_error): Adjust prototype.
1044 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1045 * typeck.c (build_unary_op): Likewise.
1046 (build_modify_expr): Likewise.
1048 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1051 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1053 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1056 * parser.c (struct cp_parser): New IN_IF_STMT.
1057 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1058 returning if parsing the body of an 'if' statement or issuing an
1059 error and continuing.
1060 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1062 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1064 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1067 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1070 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1072 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1073 Objective-C++. Don't exit early if -shared-libgcc needs to be
1076 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1078 * typeck.c (common_base_type): Delete unused function.
1080 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1082 * Make-lang.in: Add dummy lang.install-pdf target.
1084 2007-03-01 Simon Baldwin <simonb@google.com>
1087 * decl.c (check_tag_decl): Added new warning for typedef ignored
1088 when it precedes an otherwise valid non-typedef declaration.
1090 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1092 * typeck.c (build_function_call): Store converted arguments
1093 in a stack-allocated array instead of building a list.
1094 (convert_arguments): Store arguments in the array passed in as an
1095 argument, and return the actual number of arguments.
1096 * call.c (build_call): Delete, and replace with...
1097 (build_call_n, build_call_a): New.
1098 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1099 (build_over_call): Store converted arguments in a stack-allocated
1100 array instead of building a list.
1101 (build_cxx_call): Pass arguments in an array instead of as a list.
1102 (build_java_interface_fn_ref): Rewrite to avoid constructing
1104 * tree.h: Update declarations to reflect above changes.
1105 * method.c (use_thunk): Use a stack-allocated array to hold
1106 the arguments instead of a list.
1107 * rtti.c (throw_bad_cast): Update call to cxx_call.
1108 (throw_bad_typeid): Likewise.
1109 (build_dynamic_cast_1): Likewise.
1110 * init.c (build_builtin_delete_call): Use build_call_n.
1111 * decl.c (expand_static_init): Likewise.
1112 * except.c (cp_protect_cleanup_actions): Likewise.
1113 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1114 (gimplify_must_not_throw_expr): Likewise.
1115 (cxx_omp_apply_fn): Use build_call_a.
1117 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1119 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1120 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1122 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1124 * cp-tree.h (static_ctors): Remove.
1125 * cp-tree.h (static_dtors): Likewise.
1126 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1127 refactoring of tree_map hierarchy.
1128 (decl_shadowed_for_var_insert): Likewise.
1129 * semantics.c (expand_body): Use c_expand_body.
1130 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1131 * decl2.c (static_ctors): Remove.
1132 (static_dtors): Likewise.
1133 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1134 objc_generate_static_init_call. Do not call static_[cd]tors.
1135 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1137 (cp_write_global_declarations): Likewise.
1139 2007-02-23 Richard Guenther <rguenther@suse.de>
1141 * class.c (note_name_declared_in_class): Make declaration
1142 changes meaning a pedwarn.
1144 2007-02-22 Michael Matz <matz@suse.de>
1147 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1148 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1149 dump_function_decl): Guard emitting outer scopes by new flag.
1150 * cp-lang.c (cxx_dwarf_name): New function.
1151 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1152 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1154 (push_template_decl_real, lookup_template_class): Remove calls
1157 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1159 * call.c (build_new_method_call): Ensure that explicit calls of
1160 destructors have type "void".
1162 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1164 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1165 and -Walways-true with -Waddress.
1166 * cvt.c (convert_to_void): Replace unconditional warning with
1169 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1171 * decl.c, tree.c: Fix comment typos.
1173 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1176 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1177 statement expression if we had an error mark node.
1179 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1180 Brooks Moses <brooks.moses@codesourcery.com>
1181 Lee Millward <lee.millward@codesourcery.com>
1183 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1184 Change class to tcc_vl_exp.
1186 * call.c (build_call): Use build_call_list instead
1188 (build_over_call): Likewise.
1189 (build_new_method_call): Use build_min_non_dep_call_list
1190 instead of build_min_non_dep.
1192 * error.c (dump_call_expr_args): New function.
1193 (dump_aggr_init_expr_args): New function.
1194 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1195 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1197 * cvt.c (convert_to_void): Use build_call_array instead
1198 of build3; use new AGGR_INIT_EXPR accessor macros.
1200 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1201 instead of TREE_CODE_LENGTH.
1203 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1204 AGGR_INIT_EXPR accessor macros.
1206 * cp-gimplify.c (cp_gimplify_init_expr): Use
1207 AGGR_INIT_EXPR_SLOT to set the slot operand.
1209 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1210 (AGGR_INIT_EXPR_SLOT): New macro.
1211 (AGGR_INIT_EXPR_ARG): New macro.
1212 (aggr_init_expr_nargs): New macro.
1213 (AGGR_INIT_EXPR_ARGP): New macro.
1214 (aggr_init_expr_arg_iterator): New.
1215 (init_aggr_init_expr_arg_iterator): New.
1216 (next_aggr_init_expr_arg): New.
1217 (first_aggr_init_expr_arg): New.
1218 (more_aggr_init_expr_args_p): New.
1219 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1220 (stabilize_aggr_init): New declaration.
1221 (build_min_non_dep_call_list): Likewise.
1223 * tree.c (process_aggr_init_operands): New function.
1224 (build_aggr_init_array) New function.
1225 (build_cplus_new): Update to use new CALL_EXPR and
1226 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1227 build_aggr_init_array.
1228 (build_min_non_dep_call_list) New function.
1229 (build_min_nt): Assert input code parameter is not a variable
1230 length expression class.
1231 (build_min, build_min_non_dep): Likewise.
1232 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1233 to check for equality instead of recursing. Handle tcc_vl_exp
1235 (stabilize_call): Update to only handle CALL_EXPRs, not
1236 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1237 (stabilize_aggr_init): New function.
1238 (stabilize_init): Use it.
1240 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1241 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1242 AGGR_INIT_EXPR accessor macros and argument iterators.
1244 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1245 build_vl_exp. Iterate through the operands, recursively
1246 processing each one.
1247 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1248 CALL_EXPR accessor macros.
1249 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1250 tree code classes. Use TREE_OPERAND_LENGTH instead of
1253 * semantics.c (finish_call_expr): Use build_nt_call_list
1254 instead of build_nt.
1255 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1256 accessor macros. Use build_call_array to construct the
1257 CALL_EXPR node instead of build3
1259 * decl2.c (build_offset_ref_call_from_tree): Use
1260 build_nt_call_list and build_min_non_dep_call_list instead
1261 of build_min_nt and build_min_non_dep.
1263 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1264 Use build_nt_call_list instead of build_min_nt.
1266 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1269 * call.c (build_conditional_expr): Improve error message.
1271 2007-02-13 Dirk Mueller <dmueller@suse.de>
1273 * friend.c (do_friend): Annotate warning about friend
1274 declarations in templates with OPT_Wnon_template_friend.
1275 Convert informal message from warning() to inform().
1277 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1278 Mark Mitchell <mark@codesourcery.com>
1281 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1282 instantiations for variables.
1284 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1287 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1288 Check warn_unused_value just once.
1290 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1293 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1294 (fn_type_unificiation): Likewise.
1295 (get_bindings): Likewise.
1297 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1300 * decl.c (finish_function): Use DECL_REPLACEABLE.
1301 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1303 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1305 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1307 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1309 * decl.c (grokvardecl): Don't error if !have_tls.
1310 (grokdeclarator): Likewise.
1311 * parser.c (cp_parser_omp_threadprivate): Likewise.
1313 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1316 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1317 parameters and result decls in omp clauses.
1318 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1321 2007-02-05 Dirk Mueller <dmueller@suse.de>
1324 * parser.c (cp_parser_class_specifier): Always initialize bases.
1326 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1328 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1329 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1330 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1332 * semantics.c (finish_omp_atomic): Store a whole expression node
1333 in operand 1, and integer_zero_node in operand 0, for dependent
1334 OMP_ATOMIC. Rewrite to make flow easier to understand.
1336 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1338 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1340 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1342 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1343 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1345 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1347 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1348 keyword warning to -Wc++0x-compat.
1350 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1352 * decl.c (grokdeclarator): Update documentation.
1354 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1357 * decl.c (grokdeclarator): If __thread is used together with
1358 a storage class other than extern and static, clear thread_p
1359 after issuing diagnostics and fall through to checking the
1362 2007-01-30 Roger Sayle <roger@eyesopen.com>
1364 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1365 calculating the size of an array (to avoid recursive errors).
1367 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1370 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1372 * call.c (convert_like_real): Don't warn when converting to
1375 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1377 * decl.c (pop_label): Replace warning with call to
1378 warn_for_unused_label.
1380 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1383 * semantics.c (finish_pseudo_destructor_expr): Check the
1384 destrutor name by calling check_dtor_name.
1386 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1388 * lex.c (D_CPP0X): Rename.
1390 (reswords): D_CPP0X -> D_CXX0X.
1391 (init_reswords): Ditto.
1392 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1393 of C++0x keywords as identifiers.
1395 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1398 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1401 2007-01-23 Ian Lance Taylor <iant@google.com>
1403 * typeck.c (convert_for_assignment): Only warn about a = b = c
1404 when converting to bool.
1406 2007-01-23 Roger Sayle <roger@eyesopen.com>
1408 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1410 * typeck.c (ignore_overflows): Remove the remaining uses of
1411 TREE_CONSTANT_OVERFLOW.
1413 2007-01-20 Jan Hubicka <jh@suse.cz>
1415 * decl2.c (start_objects, start_static_storage_duration_function):
1416 Do not make the functions uninlinable.
1418 2007-01-17 Ian Lance Taylor <iant@google.com>
1420 * class.c (add_method): Call VEC_reserve_exact rather than passing
1421 a negative size to VEC_reserve.
1423 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1426 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1428 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1431 * decl.c (make_typename_type): If the qualified name is not a
1432 type, issue an error.
1433 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1436 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1438 * rtti.c: Include target.h.
1439 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1440 don't emit typeinfo for fundamental types as weak.
1441 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1443 2007-01-08 Richard Guenther <rguenther@suse.de>
1445 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1447 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1449 * call.c (standard_conversion): Pass flag to
1450 vector_types_convertible_p to disallow emission of note.
1451 * typeck.c (convert_for_assignment): Pass flag to
1452 vector_types_convertible_p to allow emission of note.
1453 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1454 to disallow emission of note.
1456 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1459 * typeck.c (build_binary_op): Call overflow_warning if
1460 TREE_OVERFLOW_P is true for the result and not for any of the
1463 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1466 * class.c (add_method): Don't wait until template
1467 instantiation time to complain about duplicate methods.
1469 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1472 * semantics.c (finish_unary_op_expr): Warn only if result
1473 overflowed and operands did not.
1475 2007-01-05 Ian Lance Taylor <iant@google.com>
1477 * typeck.c (build_binary_op): Warn about comparing a non-weak
1480 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1482 * pt.c (tsubst): Propagate the need for structural equality checks
1483 when reducing the level of template parameters.
1485 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1487 * pt.c: Fix a comment typo.
1489 2007-01-02 Ian Lance Taylor <iant@google.com>
1491 * semantics.c (maybe_convert_cond): Optionally warn when using an
1492 assignment as a condition.
1493 * typeck.c (convert_for_assignment): Optionally warn about
1494 assigning the result of an assignment to a bool.
1496 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1498 * pt.c (canonical_template_parms): Correct typo in comment.
1500 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1502 * typeck.c (structural_comptypes): Renamed from "comptypes".
1503 (comptypes): Use canonical type information to perform fast type
1504 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1505 canonical type comparison returns the same results as we would see
1506 from the current, structural check. Support COMPARE_STRUCTURAL
1507 when we need structural checks.
1508 * decl.c (typename_compare): Fix comment.
1509 (build_typename_type): TYPENAME_TYPE nodes require structural
1510 equality checks, because they resolve different based on the
1512 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1513 require structural equality checks (for now).
1514 (build_ptrmemfunc_type): Build the canonical pointer to member
1516 (compute_array_index_type): Whenever we build a new index type
1517 to represent the size of an array in a template, we need to mark
1518 this index type as requiring structural equality. This goes for
1519 arrays with value-dependent sizes with the current ABI, or all
1521 * tree.c (cplus_array_hash): New.
1522 (struct cplus_array_info): New.
1523 (cplus_array_compare): New.
1524 (cplus_array_htab): New.
1525 (build_cplus_array_type_1): Use a hash table to cache the array
1526 types we build. Build the canonical array type for each array
1528 (cp_build_qualified_type_real): When building a cv-qualified array
1529 type, use the hash table of array types and build canonical array
1531 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1532 use structural equality (for now).
1533 * cp-tree.h (COMPARE_STRUCTURAL): New.
1534 * pt.c (canonical_template_parms): New.
1535 (canonical_type_parameter): New.
1536 (process_template_parm): Find the canonical type parameter.
1537 (lookup_template_class): When we have named the primary template
1538 type, set the canonical type for our template class to the primary
1539 template type. If any of the template arguments need structural
1540 equality checks, the template class needs structural equality
1542 (tsubst): When reducing the level of a template template
1543 parameter, we require structural equality tests for the resulting
1544 parameter because its template parameters have not had their types
1545 canonicalized. When reducing a template type parameter, find the
1546 canonical reduced type parameter.
1547 (any_template_arguments_need_structural_equality_p): New.