1 2007-07-03 Mark Mitchell <mark@codesourcery.com>
3 * init.c (build_new): Tweak comment.
5 2007-06-29 Dave Brolley <brolley@redhat.com>
8 * parser.c (cp_parser_new_type_id): Don't reduce a named array
9 type to its base type and number of elements here.
10 * init.c (build_new): Call complete_type_or_else to ensure that the
11 type is complete and to issue a diagnostic if it is not.
12 (build_new_1): Don't call complete_type_or_else here.
14 2007-07-03 Richard Guenther <rguenther@suse.de>
17 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
20 2007-07-02 Simon Baldwin <simonb@google.com>
22 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
23 for inner-style nested forward declarations that don't declare
26 2007-07-02 Jakub Jelinek <jakub@redhat.com>
29 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
30 DECL_P in not a variable and appears more than once error messages.
32 2007-07-01 Ollie Wild <aaw@google.com>
34 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
35 (select_decl): Remove function.
36 (unqualified_namespace_lookup): Populate binding by calling
37 ambiguous_decl. Remove select_decl call.
38 (lookup_qualified_name): Remove select_decl call.
39 * decl.c (lookup_and_check_tag): Check for ambiguous references.
40 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
41 generation when name lookup is ambiguous.
43 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
46 * init.c (build_new_1): Use structural equality on the copy of the
49 2007-06-28 Geoffrey Keating <geoffk@apple.com>
51 * decl2.c (determine_visibility): Implement
52 flag_visibility_ms_compat effect on type info.
53 * decl.c (cxx_init_decl_processing): Implement
54 global effect of flag_visibility_ms_compat.
56 2007-06-28 Geoffrey Keating <geoffk@apple.com>
58 * decl2.c (start_objects): Mark constructor-running function
61 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
64 * decl.c (grokdeclarator): Reset friendp for member functions declared
65 friend of their own class.
67 2007-06-23 Mark Mitchell <mark@codesourcery.com>
69 * decl2.c (determine_visibility): Don't look for dllexport here.
70 (determine_visibility_from_class): Tidy.
72 2007-06-18 Simon Baldwin <simonb@google.com>
75 * parser.c (cp_parser_single_declaration): Added check for storage
76 class other than sc_none in parsed declaration, and a flag to indicate
77 if the call is part of an explicit template specialization parse.
78 * (cp_parser_explicit_specialization): Specialization check flag added
79 to call to cp_parser_single_declaration(), set true.
80 * (cp_parser_template_declaration_after_export): Specialization check
81 flag added to call to cp_parser_single_declaration(), set false.
82 * pt.c (check_explicit_specialization): Added code to copy visiblity
83 and linkage from the templated function to the explicit specialization.
85 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
87 * typeck.c (build_binary_op): For templates build the
88 expression in pieces to avoid the assert in build2_stat.
89 (get_member_function_from_ptrfunc):
90 Change over to using POINTER_PLUS_EXPR and convert
91 the second operand to sizetype.
92 * typeck2.c (build_m_component_ref): Likewise.
93 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
94 instead of PLUS_EXPR for pointers.
95 (build_new_1): Likewise.
96 (build_vec_delete_1): Likewise.
97 (build_vec_delete): Likewise.
98 * class.c (build_base_path): Likewise.
99 (build_base_path): Likewise.
100 (convert_to_base_statically): Likewise.
101 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
102 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
103 instead of PLUS_EXPR.
104 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
105 instead of PLUS_EXPR for pointers.
106 * call.c (build_special_member_call): Likewise.
107 * rtti.c (build_headof): Likewise.
108 Use sizetype instead of ptrdiff_type_node.
109 (tinfo_base_init): Create a POINTER_PLUS_EXPR
110 instead of PLUS_EXPR for pointers.
111 * except.c (expand_start_catch_block): Do a
112 NEGATIVE and then a POINTER_PLUS_EXPR instead
114 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
115 PLUS_EXPR on pointer types over to use
116 POINTER_PLUS_EXPR and remove the conversion
117 to the pointer types.
118 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
119 adding to a pointer type. Use size_int instead of
120 ssize_int. Convert the index to sizetype before
121 adding it to the pointer.
123 2007-06-15 Mark Mitchell <mark@codesourcery.com>
125 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
126 (DECL_ANON_UNION_VAR_P): New macro.
127 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
128 than DECL_VAR_MARKED_P, to keep track of which variables we have
130 * decl.c (redeclaration_error_message): Complain about redeclaring
131 anonymous union members at namespace scope.
132 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
134 2007-06-14 Geoff Keating <geoffk@apple.com>
136 * decl2.c (determine_visibility): Ensure that functions with
137 hidden types as parameters are hidden.
140 * decl2.c (determine_visibility): Remove duplicate code for
143 2007-06-12 Ian Lance Taylor <iant@google.com>
146 * init.c (avoid_placement_new_aliasing): New static function.
147 (build_new_1): Call it.
149 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
151 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
152 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
154 2007-06-08 Jakub Jelinek <jakub@redhat.com>
157 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
158 on init, the non-decl cond operand and increment value.
160 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
163 * decl.c (check_initializer): Report an error when a brace enclosed
164 initializer is used for a non-aggregate type in C++98.
165 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
167 (grokdeclarator): Likewise.
168 (move_fn_p): Likewise.
169 * typeck.c (check_return_expr): Likewise.
170 * call.c (reference_binding): Likewise.
171 * error.c (cp_cpp_error): Likewise.
172 * pt.c (check_default_tmpl_args): Likewise.
174 * lex.c (init_reswords): Likewise.
175 * parser.c (p_parser_primary_expression): Likewise.
176 (TOKEN_PRECEDENCE): Likewise.
177 (cp_parser_init_declarator): Likewise.
178 (cp_parser_ptr_operator): Likewise.
179 (cp_parser_parameter_declaration): Likewise.
180 (cp_parser_enclosed_template_argument_list): Likewise.
181 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
182 (cp_parser_next_token_ends_template_argument_p): Likewise.
184 2007-06-04 Simon Baldwin <simonb@google.com>
186 * decl.c (grokdeclarator): Readability change. Moved case labels
187 into direct switch statement scope.
189 2007-06-04 Paolo Carlini <pcarlini@suse.de>
191 * call.c (convert_like_real): Remove pointless code.
193 2007-05-31 Mark Mitchell <mark@codesourcery.com>
195 * decl.c (get_atexit_fn_ptr_type): New function.
196 (get_atexit_node): Use it.
197 (start_cleanup_fn): Likewise.
198 (register_dtor_fn): Use the object's destructor, instead of a
199 separate cleanup function, where possible.
200 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
201 (atexit_fn_ptr_type_node): New macro.
202 * decl2.c (build_cleanup): Use build_address.
204 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
206 * typeck.c (build_binary_op): Include types in error.
208 2007-05-31 Jakub Jelinek <jakub@redhat.com>
211 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
212 needs runtime initialization.
214 2007-05-31 Paolo Carlini <pcarlini@suse.de>
217 * semantics.c (finish_trait_expr): Complete the types.
219 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
220 Douglas Gregor <doug.gregor@gmail.com>
221 Pedro Lamarao <pedro.lamarao@mndfck.org>
222 Howard Hinnant <howard.hinnant@gmail.com>
226 * typeck.c (comptypes): Don't consider rvalue and lvalue
227 reference types to be equivalent.
228 (check_return_expr): Move from certain lvalues when returning
230 * decl.c (grokdeclarator): Implement reference collapsing.
231 (copy_fn_p): Don't consider constructors taking rvalue references
232 to be copy constructors.
234 * call.c (conversion): New "rvaluedness_matches_p" member.
235 (convert_class_to_reference): Require reference type as first
236 parameter instead of base type.
237 (reference_binding): Add logic to handle rvalue references.
238 (implicit_conversion): Update inaccurate comment.
239 (convert_like_real): Disable creation of temporaries that are
240 impossible to initialize for types with move constructors.
241 (build_over_call): Elide move constructors when possible.
242 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
243 (maybe_handle_ref_bind): Return conversion instead of type node.
244 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
245 determine preferred conversion sequences.
246 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
247 (LOOKUP_PREFER_RVALUE): New.
248 (DECL_MOVE_CONSTRUCTOR_P): New.
249 (struct cp_declarator): Add "reference" member for reference
250 types, with new "rvalue_ref" flag.
251 (cp_build_reference_type): Declare.
252 (move_fn_p): Declare.
253 * error.c (dump_type_prefix): Format rvalue reference types
254 correctly in error messages.
255 * except.c (build_throw): Move from certain lvalues when
257 * mangle.c (write_type): Mangle rvalue references differently
258 than regular references.
259 * parser.c (make_reference_declarator): Add boolean parameter for
261 (cp_parser_make_indirect_declarator): New.
262 (cp_parser_new_declarator_opt): Call
263 cp_parser_make_indirect_declarator.
264 (cp_parser_conversion_declarator_opt): Ditto.
265 (cp_parser_declarator): Ditto.
266 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
268 * pt.c (tsubst): Implement reference collapsing.
269 (maybe_adjust_types_for_deduction): Implement special template
270 parameter deduction rule for rvalue references.
271 (type_unification_real): Update calls to
272 maybe_adjust_types_for_deduction.
273 (try_one_overload): Ditto.
274 (unify_pack_expansion): Ditto.
275 * tree.c (lvalue_p_1): Handle rvalue reference types.
276 (cp_build_reference_type): New.
278 2007-05-30 Jakub Jelinek <jakub@redhat.com>
281 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
282 variables that need runtime initialization.
284 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
287 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
288 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
289 case POSTDECREMENT_EXPR>): Return the error_mark_node
290 if either the real or imaginary parts would an
293 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
294 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
297 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
298 token is a closing brace, false if there are no tokens left.
299 (cp_parser_namespace_alias_definition): Only consume the next token if
300 it is a closing brace.
302 * parser.c (cp_parser_class_specifier): Likewise.
304 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
306 * semantics.c (finish_member_declaration): Fix a typo in the
309 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
321 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
322 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
323 * pt.c (check_for_bare_parameter_packs): Return bool indicated
324 whether everything was okay. Fix indentation.
325 (push_template_decl_real): Check for bare parameter packs in
326 function parameters; where errors occur, mark the parameter types
327 with ERROR_MARK_NODEs to avert ICEs.
328 (coerce_template_parameter_pack): New.
329 (coerce_template_parms): Moved parameter pack coercion into
330 coerce_template_parameter_pack, and permit it anywhere in the
331 template parameter list (not just at the end). Parameter and
332 argument indices can vary (somewhat) separately now, so add
333 PARM_IDX and ARG_IDX.
334 (fn_type_unification): Don't set an argument pack as incomplete if
335 no argument pack was deduced.
336 (type_unification_real): If a type parameter is a parameter pack
337 and has not otherwise been deduced, it will be deduced to an empty
339 (more_specialized_fn): Use the actual lengths of the argument
340 lists when comparing against expansions.
341 * semantics.c (finish_member_declaration): If a field's type has
342 bare parameter packs, error and set its type to ERROR_MARK_NODE.
344 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
347 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
349 2007-05-22 Ollie Wild <aaw@google.com>
351 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
352 (unqualified_namespace_lookup): Adds check for hidden types.
354 2007-05-22 Ollie Wild <aaw@google.com>
356 * decl.c (duplicate_decls): Verify namespace names are unique.
358 2007-05-21 Mark Mitchell <mark@codesourcery.com>
360 * decl.c (cxx_maybe_build_cleanup): Handle
361 __attribute__((cleanup)).
363 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
365 * cvt.c (cp_convert_and_check): Don't check warnings if the
368 2007-05-18 Geoffrey Keating <geoffk@apple.com>
370 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
372 2007-05-14 Paolo Carlini <pcarlini@suse.de>
375 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
376 type only if is a class type (5.2.8/4).
378 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
380 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
381 * decl.c (grokdeclarator): Use unsigned_type_for instead of
382 c_common_unsigned_type.
384 2007-05-11 Silvius Rus <rus@google.com>
386 * cp/typeck.c (build_indirect_ref): Add call to
387 strict_aliasing_warning.
388 (build_reinterpret_cast_1): Condition call to
389 strict_aliasing_warning.
391 2007-05-11 Jan Hubicka <jh@suse.cz>
393 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
394 * decl2.c (start_objects): ctors and dtors are no longer public.
395 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
397 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
399 * typeck.c (build_unary_op): Remove code that used to
400 handle non lvalue increments/decrements.
402 2007-05-07 Mike Stump <mrs@apple.com>
404 * parser.c (check_empty_body): Add.
405 (cp_parser_iteration_statement): Add call to check_empty_body.
407 2007-05-05 Geoffrey Keating <geoffk@apple.com>
410 * mangle.c (write_mangled_name): Mangle static variable names.
411 (write_unqualified_name): Use local-source-name for
412 namespace-scope static variables.
414 2007-05-04 Dirk Mueller <dmueller@suse.de>
416 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
419 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
422 * decl2.c (constrain_class_visibility):
423 Use strip_pointer_or_array_types instead of strip_array_types.
425 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
428 * decl.c (reshape_init_r): Don't reshape the first element if it
429 is a pointer to member function.
431 2007-04-27 Simon Baldwin <simonb@google.com>
433 * decl.c (grokparms): Changed message format from %qD to %qE.
435 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
437 * error.c (maybe_warn_variadic_templates): Variadic templates are
438 now in C++0x, so only warn about them in C++98 mode.
440 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
443 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
444 integeral types from vectors types.
446 2007-04-26 Jakub Jelinek <jakub@redhat.com>
449 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
450 for type dependent OMP_CLAUSE_DECLs.
452 2007-04-24 Mark Mitchell <mark@codesourcery.com>
455 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
456 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
457 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
458 * init.c (build_zero_init): Adjust, as
459 COMPLEX_TYPE is now a SCALAR_TYPE.
460 * typeck2.c (digest_init): Allow brace-enclosed initializers for
461 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
463 2007-04-25 Paolo Carlini <pcarlini@suse.de>
465 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
466 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
467 (trait_expr_value): Adjust.
469 2007-04-23 Simon Baldwin <simonb@google.com>
471 * decl.c (grokparms): Added new error for duplicate function
472 parameters names in function prototypes, to match gcc behavior.
474 2007-04-23 Jan Hubicka <jh@suse.cz>
476 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
479 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
481 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
482 instead of checking GIMPLE_STMT_P in chain_next.
484 2007-04-17 Mark Mitchell <mark@codesourcery.com>
487 * call.c (convert_for_arg_passing): Convert bitfields to their
490 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
493 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
495 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
499 * cp/decl2.c (constrain_class_visibility):
500 Do not warn about the use of anonymous namespace in the main input file.
502 2007-04-15 Mark Mitchell <mark@codesourcery.com>
504 * cp-tree.h (current_template_parms): Fix typo in comment.
506 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
508 * cp-tree.h, error.c: Fix comment typos.
510 2007-04-13 Jason Merrill <jason@redhat.com>
513 * call.c (reference_binding): Add c_cast_p parm. If true,
514 add quals to TO as needed to make it reference-compatible.
516 2007-04-11 Jan Hubicka <jh@suse.cz>
518 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
519 that we are not processing template_decl.
521 2007-04-09 Mark Mitchell <mark@codesourcery.com>
524 * class.c (build_base_path): Ensure that the converted pointer has
525 the same cv-qualification as the input.
527 2007-04-09 Paolo Carlini <pcarlini@suse.de>
529 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
531 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
533 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
535 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
536 * tree.c (cp_add_pending_fn_decls): Remove.
537 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
539 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
541 Revert change removing staticp.
543 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
545 * cp-objcp-common.c (cxx_staticp): Remove.
546 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
547 * cp-tree.h (cxx_staticp):
549 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
551 * class.c (check_for_override): Don't remove dllmport attribute
554 2007-04-03 Jakub Jelinek <jakub@redhat.com>
557 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
558 type issue error and return early.
560 2007-03-30 Jason Merrill <jason@redhat.com>
563 * typeck.c (cp_type_readonly): New fn.
564 * cp-tree.h: Declare it.
565 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
566 (cp_finish_decl): Not here.
568 2007-03-31 Richard Guenther <rguenther@suse.de>
570 * optimize.c (maybe_clone_body): Replace splay-tree usage by
573 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
578 * parser.c (declarator_can_be_parameter_pack): New.
579 (cp_parser_template_parameter): Only parse the `...' if the
580 declarator can be a parameter pack.
581 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
583 * pt.c (find_parameter_packs_r): Look into the bounds on integer
584 types (they could be used as array bounds).
585 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
586 (tsubst_pack_expansion): Handle failure to expand parameter
589 2007-03-30 Paolo Carlini <pcarlini@suse.de>
592 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
593 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
594 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
595 (CLASS_TYPE_NON_UNION_P): Add.
596 (struct lang_type_class): Add has_complex_dflt.
597 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
598 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
599 * cp-tree.def: Add TRAIT_EXPR.
600 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
601 * lex.c (struct resword): Add __has_nothrow_assign,
602 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
603 __has_trivial_constructor, __has_trivial_copy,
604 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
605 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
606 __is_pod, __is_polymorphic, __is_union.
607 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
608 (cp_parser_trait_expr): New.
609 * semantics.c (finish_trait_expr, trait_expr_value
610 classtype_has_nothrow_copy_or_assign_p): New.
611 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
613 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
614 * class.c (check_bases, check_field_decl, check_bases_and_members):
615 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
616 * pt.c (uses_template_parms, tsubst_copy_and_build,
617 value_dependent_expression_p, type_dependent_expression_p): Deal with
619 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
621 2007-03-29 Richard Guenther <rguenther@suse.de>
623 * tree.c (cp_walk_subtrees): Do not set input_location.
625 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
628 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
631 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
633 * parser.c (struct cp_parser): Update comment for
634 greater_than_is_operator_p.
635 (cp_parser_primary_expression): In C++0x mode, a cast operator can
636 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
637 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
638 !GREATER_THAN_IS_OPERATOR_P.
639 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
640 `>>' operators that will become two `>' tokens in C++0x.
641 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
642 mode, allowing it to terminate default arguments.
643 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
644 `>>' like two consecutive `>' tokens.
645 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
646 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
647 ends a template argument.
649 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
651 * decl.c (redeclaration_error_message): Complain when redeclaring
652 a friend function with default template arguments (C++0x mode only).
653 * cp-tree.h (check_default_tmpl_args): Declare.
654 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
655 template arguments in function templates. Add support for checking
656 the default template arguments of friend templates.
657 (push_template_decl_real): Fix call to check_default_tmpl_args.
658 (type_unification_real): If a template parameter has not been
659 deduced but provides a default template argument, substitute into
660 that default template argument.
661 * parser.c (cp_parser_init_declarator): When declaring (but not
662 defining!) a function template in C++0x mode, check for default
665 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
668 * decl.c (grokdeclarator): Deal with cv-qualified function type
669 typedefs in the same way for member and non-member functions.
671 2007-03-26 Dirk Mueller <dmueller@suse.de>
673 * parser.c (cp_parser_member_declaration): Pedwarn
674 about stray semicolons after member declarations.
676 2007-03-26 Paolo Carlini <pcarlini@suse.de>
679 * pt.c (instantiate_decl): Set in_system_header.
681 2007-03-22 Mark Mitchell <mark@codesourcery.com>
683 * cp-tree.h (current_tempalte_parms): Improve documentation.
684 * pt.c (current_template_args): Likewise.
687 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
688 not consume tokens when failing.
690 2007-03-22 Jim Wilson <wilson@specifix.com>
691 Mark Mitchell <mark@codesourcery.com>
694 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
695 consistent with FROM.
697 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
699 * error.c (dump_expr): Handle dependent names that designate types.
700 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
702 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
704 * cp-tree.def, parser.c, pt.c: Fix comment typos.
706 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
708 * cvt.c (cp_convert_and_check) : Define.
709 * cp-tree.h (cp_convert_and_check): Declare.
710 * call.c (convert_conversion_warnings): Rename to
711 conversion_null_warnings. The warning for floating-point to
712 integer is handled by convert_and_check in convert_like_real.
713 (convert_like_real): convert_conversion_warnings was renamed as
714 conversion_null_warnings.
715 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
716 overflow and changes of value during conversion.
718 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
721 * parser.c (cp_parser_statement): If 'namespace' is found, this
722 only can be a namespace alias definition, so parse it now.
723 (cp_parser_namespace_alias_definition): if we find an open brace
724 instead of '=', then this is actually a misplaced namespace
727 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
730 * decl.c (cxx_init_decl_processing): Move command-line options
731 processing to c-opts.c.
733 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
735 * ptree.c (cxx_print_type): Use formatting markup for integers
736 when printing template parameter index/level/orig level.
737 (cxx_print_xnode): Ditto.
738 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
739 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
740 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
742 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
743 rather than a HOST_WIDE_INT.
744 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
745 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
747 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
748 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
749 IN_BASE_INITIALIZER bool bitfields.
750 (struct cp_declarator): Make KIND a 4-bit field. Make
751 PARAMETER_PACK_P a bool bitfield just after KIND.
752 * pt.c (uses_parameter_packs): Destroy the pointer set.
753 (make_pack_expansion): Ditto.
754 (check_for_bare_parameter_packs): Ditto.
755 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
757 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
760 * call.c (convert_default_arg): Instead of copying the node,
763 2007-03-15 Dirk Mueller <dmueller@suse.de>
766 * call.c (convert_conversion_warnings): New..
767 (convert_like_real): .. factored out from here.
768 (convert_conversion_warnings): Add warning about
769 false being converted to NULL in argument passing.
771 2007-03-14 Dirk Mueller <dmueller@suse.de>
773 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
774 (finish_do_body): Warn about empty body in do/while statement.
776 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
778 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
780 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
783 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
786 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
788 * cp/repo.c (init_repo): Initialize random_seed saved options.
789 (finish_repo): Adjust.
791 2007-03-13 Mark Mitchell <mark@codesourcery.com>
794 * Make-lang.in (doc/g++.1): Use $< to specify the location from
797 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
799 * decl.c (compute_array_index_type): New warning flag warn_vla.
801 2007-03-12 Mark Mitchell <mark@codesourcery.com>
804 * call.c (convert_default_arg): Copy non-constant arguments.
806 2007-03-11 Mark Mitchell <mark@codesourcery.com>
809 * parser.c (cp_parser_postfix_expression): Disallow compound
810 literals in constant expressions.
813 * semantics.c (finish_typeof): Use unlowered_expr_type.
815 2007-03-10 Mark Mitchell <mark@codesourcery.com>
818 * cp-tree.h (unlowered_expr_type): New function.
819 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
820 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
821 (unlowered_expr_type): New function.
822 (build_unary_op): Disallow predecrements of bool bitfields.
823 * call.c (build_conditional_expr): Use unlowered_expr_type.
824 * pt.c (type_unification_real): Likewise.
826 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
829 * typeck.c (check_return_expr): Check for bare parameter packs.
830 (comptypes): Compare template parameter packs and
831 type pack expansions.
832 * decl.c (grokdeclarator): Deal with the declaration of function
834 (grokparms): Verify that the (optional) function parameter pack is
835 at the end of the parameter list.
836 (xref_basetypes): Handle pack expansions in the base class.
837 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
838 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
839 (NONTYPE_ARGUMENT_PACK): New.
840 (TYPE_PACK_EXPANSION): New.
841 (EXPR_PACK_EXPANSION): New.
842 (ARGUMENT_PACK_SELECT): New.
843 * cp-objcp-common.c (cp_tree_size): Compute size of
844 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
845 ARGUMENT_PACK_SELECT.
846 * error.c (dump_template_argument): Print template argument packs.
847 (dump_template_argument_list): Ditto.
848 (dump_template_parameter): Dump `...' for template type parameter
850 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
851 (dump_parameters): Print function parameter packs.
852 (dump_template_parms): Print template argument packs.
853 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
854 (maybe_warn_variadic_templates): New.
855 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
856 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
857 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
859 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
860 (write_template_arg): Write argument packs as separate arguments.
861 * cp-tree.h (struct template_parm_index_s): Add flag that
862 indicates that the template parameter is actually a parameter
864 (struct tree_argument_pack_select): New.
865 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
866 (union lang_tree_node): Add argument_pack_select.
867 (FUNCTION_PARAMETER_PACK_P): New.
868 (PACK_EXPANSION_P): New.
869 (PACK_EXPANSION_PATTERN): New.
870 (SET_PACK_EXPANSION_PATTERN): New.
871 (PACK_EXPANSION_PARAMETER_PACKS): New.
872 (ARGUMENT_PACK_P): New.
873 (ARGUMENT_PACK_ARGS): New.
874 (SET_ARGUMENT_PACK_ARGS): New.
875 (ARGUMENT_PACK_INCOMPLETE_P): New.
876 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
877 (TEMPLATE_PARM_PARAMETER_PACK): New.
878 (TEMPLATE_TYPE_PARAMETER_PACK): New.
879 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
880 (ARGUMENT_PACK_SELECT_INDEX): New.
881 (ARGUMENT_PACK_SELECT_ARG): New.
882 (struct cp_declarator): Add parameter_pack_p flag.
883 (maybe_warn_variadic_templates): Declare.
884 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
885 indicate a template parameter pack.
886 (uses_parameter_packs): Declare.
887 (template_parameter_pack_p): Declare.
888 (template_parms_variadic_p): Declare.
889 (make_pack_expansion): Declare.
890 (check_for_bare_parameter_packs): Declare.
891 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
892 sizeof... expressions.
893 (pp_cxx_expression): Print pack expansions and non-type argument
895 (pp_cxx_exception_specification): Print pack expansions.
896 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
897 (pp_cxx_ctor_initializer): Print pack expansions.
898 (pp_cxx_type_id): Print pack expansions.
899 (pp_cxx_template_argument_list): Print argument packs.
900 (pp_cxx_template_parameter): Print ellipsis for template parameter
902 * pt.c (comp_template_parms): Compare template parameter packs.
903 (template_parameter_pack_p): New.
904 (template_parms_variadic_p): New.
905 (template_args_variadic_p): New.
906 (make_ith_pack_parameter_name): New.
907 (struct find_parameter_pack_data): New.
908 (find_parameter_packs_r): New.
909 (uses_parameter_packs): New.
910 (make_pack_expansion): New.
911 (check_for_bare_parameter_packs): New.
912 (expand_template_argument_pack): New.
913 (reduce_template_parm_level): Propagate parameter pack flag.
914 (process_template_parm): Add is_parameter_pack parameter to state
915 when the parameter is actually a parameter pack. Create template
916 parameter packs when is_parameter_pack is true.
917 (current_template_args): The argument for a template parameter
918 pack is an argument pack containing a single pack expansion.
919 (process_partial_specialization): When checking that non-type
920 argument expressions do not involve template parameters, loop over
921 the arguments in argument packs separately.
922 (push_template_decl_real): Check that the type of the declaration
923 does not have any bare parameter packs. Check that primary
924 templates have no more than one parameter pack, and that it comes
925 at the end of the template parameter list.
926 (convert_template_argument): Handle coercions for pack expansion
927 expressions by coercing the pattern then rebuilding the expansion.
928 (coerce_template_parms): When coercing the arguments for a
929 variadic template, pack "extra" arguments into an argument pack.
930 (coerce_template_template_parms): Cannot coerce between parameter
931 packs and non-pack parameters.
932 (template_args_equal): Compare PACK_EXPANSION_P expressions.
933 (comp_template_args): Expand all template arguments packs before
934 comparing template argument lists.
935 (mangle_class_name_for_template): Make argument packs as separate
937 (for_each_template_parm_r): No need to handle BASELINK.
938 (instantiate_class_template): Handle pack expansions in the base
940 (tsubst_pack_expansion): New.
941 (tsubst_template_args): Handle substitutions of argument packs and
942 pack expansion into template argument lists.
943 (tsubst_decl): Expand function parameter packs into separate
945 (tsubst_arg_types): Expand a type pack expansion into separate
947 (tsubst_exception_specification): Handle pack expansions in
948 exception specifiers.
949 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
950 replacing a template parameter with its argument. If we encounter
951 a substitution for an argument pack, just return the parameter
953 (tsubst_copy): sizeof(X...) returns the number of elements in
954 parameter pack X. See through ARGUMENT_PACK_SELECT when the
955 PARM_DECL is a parameter pack.
956 (tsubst_expr): Expression pack expansions and argument packs
957 cannot show up here; they will all be handled through function
958 calls, sizeof, and template argument lists.
959 (tsubst_copy_and_build): sizeof(X...) returns the number of
960 elements in parameter pack X. Handle pack expansions in TREE_LIST
961 and CONSTRUCTOR nodes.
962 (fn_type_unification): Handle "incomplete" explicit template
963 argument lists that specify some of the arguments for a template
965 (type_unification_real): Unify arguments against pack expansions.
966 (template_parm_level_and_index): New, helper function.
967 (unify_pack_expansion): New.
968 (unify): Unify argument packs on an argument-by-argument basis,
969 handling variadic argument packs as well.
970 (more_specialized_fn): Handle unification of function parameter
971 packs. All things being equal, prefer non-variadic function
972 templates to variadic function templates.
973 (more_specialized_class): Prefer the variadic class template
974 partial specialization that binds fewer arguments to a parameter
976 (regenerate_decl_from_template): Expand function parameter packs
977 into separate parameters.
978 (instantiate_decl): Ditto.
979 (tsubst_initializer_list): Handle pack expansions for base-class
981 (dependent_type_p_r): Determine dependent types in argument packs
983 (value_dependent_expression_p): Determine value-dependence of
984 non-type argument packs.
985 (dependent_template_arg_p): Handle argument packs.
986 * semantics.c (finish_cond): Check for bare parameter packs.
987 (finish_expr_stmt): Ditto.
988 (finish_for_expr): Ditto.
989 (finish_switch_cond): Ditto.
990 (finish_mem_initializers): Ditto.
991 * name-lookup.c (arg_assoc_type): Handle pack expansions and
993 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
994 * parser.c (make_declarator): Declarator is not an expansion.
995 (make_pointer_declarator): Transfer parameter pack flag to outer
997 (make_reference_declarator): Ditto.
998 (make_ptrmem_declarator): Ditto.
999 (make_call_declarator): Ditto.
1000 (make_array_declarator): Ditto.
1001 (cp_parser_postfix_expression): Allow pack expansion expressions
1002 in the argument list for a call expression.
1003 (cp_parser_parenthesized_expression_list): Add new parameter
1004 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1005 into separate arguments."
1006 (cp_parser_new_placement): Allow pack expansion expressions.
1007 (cp_parser_new_initializer): Ditto.
1008 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1009 base-class initializer expansion.
1010 (cp_parser_mem_initializer): Ditto.
1011 (cp_parser_template_parameter_list): Keep track of whether the
1012 template parameter is a template parameter pack.
1013 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1014 template parameter pack.
1015 (cp_parser_type_parameter): Ditto.
1016 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1018 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1019 this declarator is a parameter pack.
1020 (cp_parser_parameter_declaration): The ellipsis does not end the
1021 parameter declaration, because it might be a parameter pack. Parse
1022 the ellipsis to indicate a parameter pack.
1023 (cp_parser_initializer): Allow pack expansions.
1024 (cp_parser_initializer_list): Allow ellipsis to create an
1025 initializer expansion.
1026 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1028 (cp_parser_type_id_list): Allow ellipsis to create an exception
1029 specifier expansion.
1030 (cp_parser_attribute_list): Don't allow pack expansions.
1031 (cp_parser_functional_cast): Allow pack expansions.
1032 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1033 compute the length of a parameter pack.
1034 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1035 end a template argument.
1036 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1037 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1040 2007-03-09 Dirk Mueller <dmueller@suse.de>
1042 * cp/call.c (build_new_op): Call warn_logical_operator.
1044 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1047 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1050 * pt.c (any_template_arguments_need_structural_equality_p):
1053 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1055 * decl.c (grokdeclarator): Disable warnings for anonymous
1058 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1060 * typeck2.c (readonly_error): Always emit a hard error.
1061 Remove last argument.
1062 * cp-tree.h (readonly_error): Adjust prototype.
1063 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1064 * typeck.c (build_unary_op): Likewise.
1065 (build_modify_expr): Likewise.
1067 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1070 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1072 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1075 * parser.c (struct cp_parser): New IN_IF_STMT.
1076 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1077 returning if parsing the body of an 'if' statement or issuing an
1078 error and continuing.
1079 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1081 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1083 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1086 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1089 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1091 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1092 Objective-C++. Don't exit early if -shared-libgcc needs to be
1095 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1097 * typeck.c (common_base_type): Delete unused function.
1099 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1101 * Make-lang.in: Add dummy lang.install-pdf target.
1103 2007-03-01 Simon Baldwin <simonb@google.com>
1106 * decl.c (check_tag_decl): Added new warning for typedef ignored
1107 when it precedes an otherwise valid non-typedef declaration.
1109 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1111 * typeck.c (build_function_call): Store converted arguments
1112 in a stack-allocated array instead of building a list.
1113 (convert_arguments): Store arguments in the array passed in as an
1114 argument, and return the actual number of arguments.
1115 * call.c (build_call): Delete, and replace with...
1116 (build_call_n, build_call_a): New.
1117 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1118 (build_over_call): Store converted arguments in a stack-allocated
1119 array instead of building a list.
1120 (build_cxx_call): Pass arguments in an array instead of as a list.
1121 (build_java_interface_fn_ref): Rewrite to avoid constructing
1123 * tree.h: Update declarations to reflect above changes.
1124 * method.c (use_thunk): Use a stack-allocated array to hold
1125 the arguments instead of a list.
1126 * rtti.c (throw_bad_cast): Update call to cxx_call.
1127 (throw_bad_typeid): Likewise.
1128 (build_dynamic_cast_1): Likewise.
1129 * init.c (build_builtin_delete_call): Use build_call_n.
1130 * decl.c (expand_static_init): Likewise.
1131 * except.c (cp_protect_cleanup_actions): Likewise.
1132 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1133 (gimplify_must_not_throw_expr): Likewise.
1134 (cxx_omp_apply_fn): Use build_call_a.
1136 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1138 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1139 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1141 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1143 * cp-tree.h (static_ctors): Remove.
1144 * cp-tree.h (static_dtors): Likewise.
1145 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1146 refactoring of tree_map hierarchy.
1147 (decl_shadowed_for_var_insert): Likewise.
1148 * semantics.c (expand_body): Use c_expand_body.
1149 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1150 * decl2.c (static_ctors): Remove.
1151 (static_dtors): Likewise.
1152 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1153 objc_generate_static_init_call. Do not call static_[cd]tors.
1154 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1156 (cp_write_global_declarations): Likewise.
1158 2007-02-23 Richard Guenther <rguenther@suse.de>
1160 * class.c (note_name_declared_in_class): Make declaration
1161 changes meaning a pedwarn.
1163 2007-02-22 Michael Matz <matz@suse.de>
1166 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1167 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1168 dump_function_decl): Guard emitting outer scopes by new flag.
1169 * cp-lang.c (cxx_dwarf_name): New function.
1170 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1171 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1173 (push_template_decl_real, lookup_template_class): Remove calls
1176 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1178 * call.c (build_new_method_call): Ensure that explicit calls of
1179 destructors have type "void".
1181 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1183 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1184 and -Walways-true with -Waddress.
1185 * cvt.c (convert_to_void): Replace unconditional warning with
1188 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1190 * decl.c, tree.c: Fix comment typos.
1192 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1195 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1196 statement expression if we had an error mark node.
1198 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1199 Brooks Moses <brooks.moses@codesourcery.com>
1200 Lee Millward <lee.millward@codesourcery.com>
1202 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1203 Change class to tcc_vl_exp.
1205 * call.c (build_call): Use build_call_list instead
1207 (build_over_call): Likewise.
1208 (build_new_method_call): Use build_min_non_dep_call_list
1209 instead of build_min_non_dep.
1211 * error.c (dump_call_expr_args): New function.
1212 (dump_aggr_init_expr_args): New function.
1213 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1214 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1216 * cvt.c (convert_to_void): Use build_call_array instead
1217 of build3; use new AGGR_INIT_EXPR accessor macros.
1219 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1220 instead of TREE_CODE_LENGTH.
1222 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1223 AGGR_INIT_EXPR accessor macros.
1225 * cp-gimplify.c (cp_gimplify_init_expr): Use
1226 AGGR_INIT_EXPR_SLOT to set the slot operand.
1228 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1229 (AGGR_INIT_EXPR_SLOT): New macro.
1230 (AGGR_INIT_EXPR_ARG): New macro.
1231 (aggr_init_expr_nargs): New macro.
1232 (AGGR_INIT_EXPR_ARGP): New macro.
1233 (aggr_init_expr_arg_iterator): New.
1234 (init_aggr_init_expr_arg_iterator): New.
1235 (next_aggr_init_expr_arg): New.
1236 (first_aggr_init_expr_arg): New.
1237 (more_aggr_init_expr_args_p): New.
1238 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1239 (stabilize_aggr_init): New declaration.
1240 (build_min_non_dep_call_list): Likewise.
1242 * tree.c (process_aggr_init_operands): New function.
1243 (build_aggr_init_array) New function.
1244 (build_cplus_new): Update to use new CALL_EXPR and
1245 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1246 build_aggr_init_array.
1247 (build_min_non_dep_call_list) New function.
1248 (build_min_nt): Assert input code parameter is not a variable
1249 length expression class.
1250 (build_min, build_min_non_dep): Likewise.
1251 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1252 to check for equality instead of recursing. Handle tcc_vl_exp
1254 (stabilize_call): Update to only handle CALL_EXPRs, not
1255 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1256 (stabilize_aggr_init): New function.
1257 (stabilize_init): Use it.
1259 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1260 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1261 AGGR_INIT_EXPR accessor macros and argument iterators.
1263 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1264 build_vl_exp. Iterate through the operands, recursively
1265 processing each one.
1266 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1267 CALL_EXPR accessor macros.
1268 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1269 tree code classes. Use TREE_OPERAND_LENGTH instead of
1272 * semantics.c (finish_call_expr): Use build_nt_call_list
1273 instead of build_nt.
1274 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1275 accessor macros. Use build_call_array to construct the
1276 CALL_EXPR node instead of build3
1278 * decl2.c (build_offset_ref_call_from_tree): Use
1279 build_nt_call_list and build_min_non_dep_call_list instead
1280 of build_min_nt and build_min_non_dep.
1282 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1283 Use build_nt_call_list instead of build_min_nt.
1285 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1288 * call.c (build_conditional_expr): Improve error message.
1290 2007-02-13 Dirk Mueller <dmueller@suse.de>
1292 * friend.c (do_friend): Annotate warning about friend
1293 declarations in templates with OPT_Wnon_template_friend.
1294 Convert informal message from warning() to inform().
1296 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1297 Mark Mitchell <mark@codesourcery.com>
1300 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1301 instantiations for variables.
1303 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1306 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1307 Check warn_unused_value just once.
1309 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1312 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1313 (fn_type_unificiation): Likewise.
1314 (get_bindings): Likewise.
1316 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1319 * decl.c (finish_function): Use DECL_REPLACEABLE.
1320 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1322 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1324 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1326 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1328 * decl.c (grokvardecl): Don't error if !have_tls.
1329 (grokdeclarator): Likewise.
1330 * parser.c (cp_parser_omp_threadprivate): Likewise.
1332 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1335 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1336 parameters and result decls in omp clauses.
1337 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1340 2007-02-05 Dirk Mueller <dmueller@suse.de>
1343 * parser.c (cp_parser_class_specifier): Always initialize bases.
1345 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1347 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1348 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1349 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1351 * semantics.c (finish_omp_atomic): Store a whole expression node
1352 in operand 1, and integer_zero_node in operand 0, for dependent
1353 OMP_ATOMIC. Rewrite to make flow easier to understand.
1355 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1357 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1359 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1361 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1362 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1364 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1366 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1367 keyword warning to -Wc++0x-compat.
1369 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1371 * decl.c (grokdeclarator): Update documentation.
1373 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1376 * decl.c (grokdeclarator): If __thread is used together with
1377 a storage class other than extern and static, clear thread_p
1378 after issuing diagnostics and fall through to checking the
1381 2007-01-30 Roger Sayle <roger@eyesopen.com>
1383 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1384 calculating the size of an array (to avoid recursive errors).
1386 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1389 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1391 * call.c (convert_like_real): Don't warn when converting to
1394 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1396 * decl.c (pop_label): Replace warning with call to
1397 warn_for_unused_label.
1399 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1402 * semantics.c (finish_pseudo_destructor_expr): Check the
1403 destrutor name by calling check_dtor_name.
1405 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1407 * lex.c (D_CPP0X): Rename.
1409 (reswords): D_CPP0X -> D_CXX0X.
1410 (init_reswords): Ditto.
1411 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1412 of C++0x keywords as identifiers.
1414 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1417 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1420 2007-01-23 Ian Lance Taylor <iant@google.com>
1422 * typeck.c (convert_for_assignment): Only warn about a = b = c
1423 when converting to bool.
1425 2007-01-23 Roger Sayle <roger@eyesopen.com>
1427 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1429 * typeck.c (ignore_overflows): Remove the remaining uses of
1430 TREE_CONSTANT_OVERFLOW.
1432 2007-01-20 Jan Hubicka <jh@suse.cz>
1434 * decl2.c (start_objects, start_static_storage_duration_function):
1435 Do not make the functions uninlinable.
1437 2007-01-17 Ian Lance Taylor <iant@google.com>
1439 * class.c (add_method): Call VEC_reserve_exact rather than passing
1440 a negative size to VEC_reserve.
1442 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1445 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1447 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1450 * decl.c (make_typename_type): If the qualified name is not a
1451 type, issue an error.
1452 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1455 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1457 * rtti.c: Include target.h.
1458 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1459 don't emit typeinfo for fundamental types as weak.
1460 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1462 2007-01-08 Richard Guenther <rguenther@suse.de>
1464 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1466 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1468 * call.c (standard_conversion): Pass flag to
1469 vector_types_convertible_p to disallow emission of note.
1470 * typeck.c (convert_for_assignment): Pass flag to
1471 vector_types_convertible_p to allow emission of note.
1472 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1473 to disallow emission of note.
1475 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1478 * typeck.c (build_binary_op): Call overflow_warning if
1479 TREE_OVERFLOW_P is true for the result and not for any of the
1482 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1485 * class.c (add_method): Don't wait until template
1486 instantiation time to complain about duplicate methods.
1488 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1491 * semantics.c (finish_unary_op_expr): Warn only if result
1492 overflowed and operands did not.
1494 2007-01-05 Ian Lance Taylor <iant@google.com>
1496 * typeck.c (build_binary_op): Warn about comparing a non-weak
1499 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1501 * pt.c (tsubst): Propagate the need for structural equality checks
1502 when reducing the level of template parameters.
1504 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1506 * pt.c: Fix a comment typo.
1508 2007-01-02 Ian Lance Taylor <iant@google.com>
1510 * semantics.c (maybe_convert_cond): Optionally warn when using an
1511 assignment as a condition.
1512 * typeck.c (convert_for_assignment): Optionally warn about
1513 assigning the result of an assignment to a bool.
1515 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1517 * pt.c (canonical_template_parms): Correct typo in comment.
1519 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1521 * typeck.c (structural_comptypes): Renamed from "comptypes".
1522 (comptypes): Use canonical type information to perform fast type
1523 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1524 canonical type comparison returns the same results as we would see
1525 from the current, structural check. Support COMPARE_STRUCTURAL
1526 when we need structural checks.
1527 * decl.c (typename_compare): Fix comment.
1528 (build_typename_type): TYPENAME_TYPE nodes require structural
1529 equality checks, because they resolve different based on the
1531 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1532 require structural equality checks (for now).
1533 (build_ptrmemfunc_type): Build the canonical pointer to member
1535 (compute_array_index_type): Whenever we build a new index type
1536 to represent the size of an array in a template, we need to mark
1537 this index type as requiring structural equality. This goes for
1538 arrays with value-dependent sizes with the current ABI, or all
1540 * tree.c (cplus_array_hash): New.
1541 (struct cplus_array_info): New.
1542 (cplus_array_compare): New.
1543 (cplus_array_htab): New.
1544 (build_cplus_array_type_1): Use a hash table to cache the array
1545 types we build. Build the canonical array type for each array
1547 (cp_build_qualified_type_real): When building a cv-qualified array
1548 type, use the hash table of array types and build canonical array
1550 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1551 use structural equality (for now).
1552 * cp-tree.h (COMPARE_STRUCTURAL): New.
1553 * pt.c (canonical_template_parms): New.
1554 (canonical_type_parameter): New.
1555 (process_template_parm): Find the canonical type parameter.
1556 (lookup_template_class): When we have named the primary template
1557 type, set the canonical type for our template class to the primary
1558 template type. If any of the template arguments need structural
1559 equality checks, the template class needs structural equality
1561 (tsubst): When reducing the level of a template template
1562 parameter, we require structural equality tests for the resulting
1563 parameter because its template parameters have not had their types
1564 canonicalized. When reducing a template type parameter, find the
1565 canonical reduced type parameter.
1566 (any_template_arguments_need_structural_equality_p): New.