1 2007-07-09 Richard Guenther <rguenther@suse.de>
3 * decl.c (start_preparsed_function): Do not promote return type.
5 2007-07-08 Paolo Carlini <pcarlini@suse.de>
8 * pt.c (unify): Never pass error_mark_node to template_decl_level.
10 2007-07-07 Mark Mitchell <mark@codesourcery.com>
13 * pt.c (resolve_overloaded_unification): Robustify. Return a
15 (type_unification_real): Adjust accordingly.
17 2007-07-06 Richard Guenther <rguenther@suse.de>
19 * init.c (build_new_1): Use the correct pointer type.
20 * typeck2.c (build_m_component_ref): Likewise.
22 2007-07-05 Mark Mitchell <mark@codesourcery.com>
25 * init.c (build_zero_init): Always build an initializer for
27 * typeck2.c (build_functional_cast): Use build_zero_init.
30 * init.c (build_new_1): Always pass the allocation function to
32 * call.c (build_op_delete_call): Handle operator delete with a
33 variable-argument list. Do not issue an error when no matching
34 deallocation function is available for a new operator.
37 * cp-tree.h (any_value_dependent_elements_p): Declare it.
38 * decl.c (value_dependent_init_p): New function.
39 (cp_finish_decl): Use it.
40 * pt.c (value_dependent_expression_p): Use
41 any_value_dependent_elements_p.
42 * parser.c (cp_parser_primary_expression): Add comment about
43 treating dependent qualified names as integral
46 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
48 * decl.c (build_ptrmemfunc_type): Always use structural equality
49 tests when comparing pointer-to-member-function types, because the
50 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
53 2007-07-03 Mark Mitchell <mark@codesourcery.com>
55 * init.c (build_new): Tweak comment.
57 2007-06-29 Dave Brolley <brolley@redhat.com>
60 * parser.c (cp_parser_new_type_id): Don't reduce a named array
61 type to its base type and number of elements here.
62 * init.c (build_new): Call complete_type_or_else to ensure that the
63 type is complete and to issue a diagnostic if it is not.
64 (build_new_1): Don't call complete_type_or_else here.
66 2007-07-03 Richard Guenther <rguenther@suse.de>
69 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
72 2007-07-02 Simon Baldwin <simonb@google.com>
74 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
75 for inner-style nested forward declarations that don't declare
78 2007-07-02 Jakub Jelinek <jakub@redhat.com>
81 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
82 DECL_P in not a variable and appears more than once error messages.
84 2007-07-01 Ollie Wild <aaw@google.com>
86 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
87 (select_decl): Remove function.
88 (unqualified_namespace_lookup): Populate binding by calling
89 ambiguous_decl. Remove select_decl call.
90 (lookup_qualified_name): Remove select_decl call.
91 * decl.c (lookup_and_check_tag): Check for ambiguous references.
92 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
93 generation when name lookup is ambiguous.
95 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
98 * init.c (build_new_1): Use structural equality on the copy of the
101 2007-06-28 Geoffrey Keating <geoffk@apple.com>
103 * decl2.c (determine_visibility): Implement
104 flag_visibility_ms_compat effect on type info.
105 * decl.c (cxx_init_decl_processing): Implement
106 global effect of flag_visibility_ms_compat.
108 2007-06-28 Geoffrey Keating <geoffk@apple.com>
110 * decl2.c (start_objects): Mark constructor-running function
113 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
116 * decl.c (grokdeclarator): Reset friendp for member functions declared
117 friend of their own class.
119 2007-06-23 Mark Mitchell <mark@codesourcery.com>
121 * decl2.c (determine_visibility): Don't look for dllexport here.
122 (determine_visibility_from_class): Tidy.
124 2007-06-18 Simon Baldwin <simonb@google.com>
127 * parser.c (cp_parser_single_declaration): Added check for storage
128 class other than sc_none in parsed declaration, and a flag to indicate
129 if the call is part of an explicit template specialization parse.
130 * (cp_parser_explicit_specialization): Specialization check flag added
131 to call to cp_parser_single_declaration(), set true.
132 * (cp_parser_template_declaration_after_export): Specialization check
133 flag added to call to cp_parser_single_declaration(), set false.
134 * pt.c (check_explicit_specialization): Added code to copy visiblity
135 and linkage from the templated function to the explicit specialization.
137 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
139 * typeck.c (build_binary_op): For templates build the
140 expression in pieces to avoid the assert in build2_stat.
141 (get_member_function_from_ptrfunc):
142 Change over to using POINTER_PLUS_EXPR and convert
143 the second operand to sizetype.
144 * typeck2.c (build_m_component_ref): Likewise.
145 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
146 instead of PLUS_EXPR for pointers.
147 (build_new_1): Likewise.
148 (build_vec_delete_1): Likewise.
149 (build_vec_delete): Likewise.
150 * class.c (build_base_path): Likewise.
151 (build_base_path): Likewise.
152 (convert_to_base_statically): Likewise.
153 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
154 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
155 instead of PLUS_EXPR.
156 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
157 instead of PLUS_EXPR for pointers.
158 * call.c (build_special_member_call): Likewise.
159 * rtti.c (build_headof): Likewise.
160 Use sizetype instead of ptrdiff_type_node.
161 (tinfo_base_init): Create a POINTER_PLUS_EXPR
162 instead of PLUS_EXPR for pointers.
163 * except.c (expand_start_catch_block): Do a
164 NEGATIVE and then a POINTER_PLUS_EXPR instead
166 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
167 PLUS_EXPR on pointer types over to use
168 POINTER_PLUS_EXPR and remove the conversion
169 to the pointer types.
170 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
171 adding to a pointer type. Use size_int instead of
172 ssize_int. Convert the index to sizetype before
173 adding it to the pointer.
175 2007-06-15 Mark Mitchell <mark@codesourcery.com>
177 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
178 (DECL_ANON_UNION_VAR_P): New macro.
179 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
180 than DECL_VAR_MARKED_P, to keep track of which variables we have
182 * decl.c (redeclaration_error_message): Complain about redeclaring
183 anonymous union members at namespace scope.
184 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
186 2007-06-14 Geoff Keating <geoffk@apple.com>
188 * decl2.c (determine_visibility): Ensure that functions with
189 hidden types as parameters are hidden.
192 * decl2.c (determine_visibility): Remove duplicate code for
195 2007-06-12 Ian Lance Taylor <iant@google.com>
198 * init.c (avoid_placement_new_aliasing): New static function.
199 (build_new_1): Call it.
201 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
203 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
204 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
206 2007-06-08 Jakub Jelinek <jakub@redhat.com>
209 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
210 on init, the non-decl cond operand and increment value.
212 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
215 * decl.c (check_initializer): Report an error when a brace enclosed
216 initializer is used for a non-aggregate type in C++98.
217 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
219 (grokdeclarator): Likewise.
220 (move_fn_p): Likewise.
221 * typeck.c (check_return_expr): Likewise.
222 * call.c (reference_binding): Likewise.
223 * error.c (cp_cpp_error): Likewise.
224 * pt.c (check_default_tmpl_args): Likewise.
226 * lex.c (init_reswords): Likewise.
227 * parser.c (p_parser_primary_expression): Likewise.
228 (TOKEN_PRECEDENCE): Likewise.
229 (cp_parser_init_declarator): Likewise.
230 (cp_parser_ptr_operator): Likewise.
231 (cp_parser_parameter_declaration): Likewise.
232 (cp_parser_enclosed_template_argument_list): Likewise.
233 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
234 (cp_parser_next_token_ends_template_argument_p): Likewise.
236 2007-06-04 Simon Baldwin <simonb@google.com>
238 * decl.c (grokdeclarator): Readability change. Moved case labels
239 into direct switch statement scope.
241 2007-06-04 Paolo Carlini <pcarlini@suse.de>
243 * call.c (convert_like_real): Remove pointless code.
245 2007-05-31 Mark Mitchell <mark@codesourcery.com>
247 * decl.c (get_atexit_fn_ptr_type): New function.
248 (get_atexit_node): Use it.
249 (start_cleanup_fn): Likewise.
250 (register_dtor_fn): Use the object's destructor, instead of a
251 separate cleanup function, where possible.
252 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
253 (atexit_fn_ptr_type_node): New macro.
254 * decl2.c (build_cleanup): Use build_address.
256 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
258 * typeck.c (build_binary_op): Include types in error.
260 2007-05-31 Jakub Jelinek <jakub@redhat.com>
263 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
264 needs runtime initialization.
266 2007-05-31 Paolo Carlini <pcarlini@suse.de>
269 * semantics.c (finish_trait_expr): Complete the types.
271 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
272 Douglas Gregor <doug.gregor@gmail.com>
273 Pedro Lamarao <pedro.lamarao@mndfck.org>
274 Howard Hinnant <howard.hinnant@gmail.com>
278 * typeck.c (comptypes): Don't consider rvalue and lvalue
279 reference types to be equivalent.
280 (check_return_expr): Move from certain lvalues when returning
282 * decl.c (grokdeclarator): Implement reference collapsing.
283 (copy_fn_p): Don't consider constructors taking rvalue references
284 to be copy constructors.
286 * call.c (conversion): New "rvaluedness_matches_p" member.
287 (convert_class_to_reference): Require reference type as first
288 parameter instead of base type.
289 (reference_binding): Add logic to handle rvalue references.
290 (implicit_conversion): Update inaccurate comment.
291 (convert_like_real): Disable creation of temporaries that are
292 impossible to initialize for types with move constructors.
293 (build_over_call): Elide move constructors when possible.
294 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
295 (maybe_handle_ref_bind): Return conversion instead of type node.
296 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
297 determine preferred conversion sequences.
298 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
299 (LOOKUP_PREFER_RVALUE): New.
300 (DECL_MOVE_CONSTRUCTOR_P): New.
301 (struct cp_declarator): Add "reference" member for reference
302 types, with new "rvalue_ref" flag.
303 (cp_build_reference_type): Declare.
304 (move_fn_p): Declare.
305 * error.c (dump_type_prefix): Format rvalue reference types
306 correctly in error messages.
307 * except.c (build_throw): Move from certain lvalues when
309 * mangle.c (write_type): Mangle rvalue references differently
310 than regular references.
311 * parser.c (make_reference_declarator): Add boolean parameter for
313 (cp_parser_make_indirect_declarator): New.
314 (cp_parser_new_declarator_opt): Call
315 cp_parser_make_indirect_declarator.
316 (cp_parser_conversion_declarator_opt): Ditto.
317 (cp_parser_declarator): Ditto.
318 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
320 * pt.c (tsubst): Implement reference collapsing.
321 (maybe_adjust_types_for_deduction): Implement special template
322 parameter deduction rule for rvalue references.
323 (type_unification_real): Update calls to
324 maybe_adjust_types_for_deduction.
325 (try_one_overload): Ditto.
326 (unify_pack_expansion): Ditto.
327 * tree.c (lvalue_p_1): Handle rvalue reference types.
328 (cp_build_reference_type): New.
330 2007-05-30 Jakub Jelinek <jakub@redhat.com>
333 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
334 variables that need runtime initialization.
336 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
339 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
340 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
341 case POSTDECREMENT_EXPR>): Return the error_mark_node
342 if either the real or imaginary parts would an
345 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
346 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
349 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
350 token is a closing brace, false if there are no tokens left.
351 (cp_parser_namespace_alias_definition): Only consume the next token if
352 it is a closing brace.
354 * parser.c (cp_parser_class_specifier): Likewise.
356 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
358 * semantics.c (finish_member_declaration): Fix a typo in the
361 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
373 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
374 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
375 * pt.c (check_for_bare_parameter_packs): Return bool indicated
376 whether everything was okay. Fix indentation.
377 (push_template_decl_real): Check for bare parameter packs in
378 function parameters; where errors occur, mark the parameter types
379 with ERROR_MARK_NODEs to avert ICEs.
380 (coerce_template_parameter_pack): New.
381 (coerce_template_parms): Moved parameter pack coercion into
382 coerce_template_parameter_pack, and permit it anywhere in the
383 template parameter list (not just at the end). Parameter and
384 argument indices can vary (somewhat) separately now, so add
385 PARM_IDX and ARG_IDX.
386 (fn_type_unification): Don't set an argument pack as incomplete if
387 no argument pack was deduced.
388 (type_unification_real): If a type parameter is a parameter pack
389 and has not otherwise been deduced, it will be deduced to an empty
391 (more_specialized_fn): Use the actual lengths of the argument
392 lists when comparing against expansions.
393 * semantics.c (finish_member_declaration): If a field's type has
394 bare parameter packs, error and set its type to ERROR_MARK_NODE.
396 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
399 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
401 2007-05-22 Ollie Wild <aaw@google.com>
403 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
404 (unqualified_namespace_lookup): Adds check for hidden types.
406 2007-05-22 Ollie Wild <aaw@google.com>
408 * decl.c (duplicate_decls): Verify namespace names are unique.
410 2007-05-21 Mark Mitchell <mark@codesourcery.com>
412 * decl.c (cxx_maybe_build_cleanup): Handle
413 __attribute__((cleanup)).
415 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
417 * cvt.c (cp_convert_and_check): Don't check warnings if the
420 2007-05-18 Geoffrey Keating <geoffk@apple.com>
422 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
424 2007-05-14 Paolo Carlini <pcarlini@suse.de>
427 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
428 type only if is a class type (5.2.8/4).
430 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
432 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
433 * decl.c (grokdeclarator): Use unsigned_type_for instead of
434 c_common_unsigned_type.
436 2007-05-11 Silvius Rus <rus@google.com>
438 * cp/typeck.c (build_indirect_ref): Add call to
439 strict_aliasing_warning.
440 (build_reinterpret_cast_1): Condition call to
441 strict_aliasing_warning.
443 2007-05-11 Jan Hubicka <jh@suse.cz>
445 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
446 * decl2.c (start_objects): ctors and dtors are no longer public.
447 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
449 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
451 * typeck.c (build_unary_op): Remove code that used to
452 handle non lvalue increments/decrements.
454 2007-05-07 Mike Stump <mrs@apple.com>
456 * parser.c (check_empty_body): Add.
457 (cp_parser_iteration_statement): Add call to check_empty_body.
459 2007-05-05 Geoffrey Keating <geoffk@apple.com>
462 * mangle.c (write_mangled_name): Mangle static variable names.
463 (write_unqualified_name): Use local-source-name for
464 namespace-scope static variables.
466 2007-05-04 Dirk Mueller <dmueller@suse.de>
468 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
471 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
474 * decl2.c (constrain_class_visibility):
475 Use strip_pointer_or_array_types instead of strip_array_types.
477 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
480 * decl.c (reshape_init_r): Don't reshape the first element if it
481 is a pointer to member function.
483 2007-04-27 Simon Baldwin <simonb@google.com>
485 * decl.c (grokparms): Changed message format from %qD to %qE.
487 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
489 * error.c (maybe_warn_variadic_templates): Variadic templates are
490 now in C++0x, so only warn about them in C++98 mode.
492 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
495 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
496 integeral types from vectors types.
498 2007-04-26 Jakub Jelinek <jakub@redhat.com>
501 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
502 for type dependent OMP_CLAUSE_DECLs.
504 2007-04-24 Mark Mitchell <mark@codesourcery.com>
507 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
508 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
509 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
510 * init.c (build_zero_init): Adjust, as
511 COMPLEX_TYPE is now a SCALAR_TYPE.
512 * typeck2.c (digest_init): Allow brace-enclosed initializers for
513 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
515 2007-04-25 Paolo Carlini <pcarlini@suse.de>
517 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
518 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
519 (trait_expr_value): Adjust.
521 2007-04-23 Simon Baldwin <simonb@google.com>
523 * decl.c (grokparms): Added new error for duplicate function
524 parameters names in function prototypes, to match gcc behavior.
526 2007-04-23 Jan Hubicka <jh@suse.cz>
528 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
531 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
533 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
534 instead of checking GIMPLE_STMT_P in chain_next.
536 2007-04-17 Mark Mitchell <mark@codesourcery.com>
539 * call.c (convert_for_arg_passing): Convert bitfields to their
542 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
545 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
547 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
551 * cp/decl2.c (constrain_class_visibility):
552 Do not warn about the use of anonymous namespace in the main input file.
554 2007-04-15 Mark Mitchell <mark@codesourcery.com>
556 * cp-tree.h (current_template_parms): Fix typo in comment.
558 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
560 * cp-tree.h, error.c: Fix comment typos.
562 2007-04-13 Jason Merrill <jason@redhat.com>
565 * call.c (reference_binding): Add c_cast_p parm. If true,
566 add quals to TO as needed to make it reference-compatible.
568 2007-04-11 Jan Hubicka <jh@suse.cz>
570 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
571 that we are not processing template_decl.
573 2007-04-09 Mark Mitchell <mark@codesourcery.com>
576 * class.c (build_base_path): Ensure that the converted pointer has
577 the same cv-qualification as the input.
579 2007-04-09 Paolo Carlini <pcarlini@suse.de>
581 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
583 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
585 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
587 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
588 * tree.c (cp_add_pending_fn_decls): Remove.
589 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
591 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
593 Revert change removing staticp.
595 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
597 * cp-objcp-common.c (cxx_staticp): Remove.
598 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
599 * cp-tree.h (cxx_staticp):
601 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
603 * class.c (check_for_override): Don't remove dllmport attribute
606 2007-04-03 Jakub Jelinek <jakub@redhat.com>
609 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
610 type issue error and return early.
612 2007-03-30 Jason Merrill <jason@redhat.com>
615 * typeck.c (cp_type_readonly): New fn.
616 * cp-tree.h: Declare it.
617 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
618 (cp_finish_decl): Not here.
620 2007-03-31 Richard Guenther <rguenther@suse.de>
622 * optimize.c (maybe_clone_body): Replace splay-tree usage by
625 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
630 * parser.c (declarator_can_be_parameter_pack): New.
631 (cp_parser_template_parameter): Only parse the `...' if the
632 declarator can be a parameter pack.
633 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
635 * pt.c (find_parameter_packs_r): Look into the bounds on integer
636 types (they could be used as array bounds).
637 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
638 (tsubst_pack_expansion): Handle failure to expand parameter
641 2007-03-30 Paolo Carlini <pcarlini@suse.de>
644 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
645 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
646 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
647 (CLASS_TYPE_NON_UNION_P): Add.
648 (struct lang_type_class): Add has_complex_dflt.
649 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
650 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
651 * cp-tree.def: Add TRAIT_EXPR.
652 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
653 * lex.c (struct resword): Add __has_nothrow_assign,
654 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
655 __has_trivial_constructor, __has_trivial_copy,
656 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
657 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
658 __is_pod, __is_polymorphic, __is_union.
659 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
660 (cp_parser_trait_expr): New.
661 * semantics.c (finish_trait_expr, trait_expr_value
662 classtype_has_nothrow_copy_or_assign_p): New.
663 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
665 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
666 * class.c (check_bases, check_field_decl, check_bases_and_members):
667 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
668 * pt.c (uses_template_parms, tsubst_copy_and_build,
669 value_dependent_expression_p, type_dependent_expression_p): Deal with
671 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
673 2007-03-29 Richard Guenther <rguenther@suse.de>
675 * tree.c (cp_walk_subtrees): Do not set input_location.
677 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
680 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
683 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
685 * parser.c (struct cp_parser): Update comment for
686 greater_than_is_operator_p.
687 (cp_parser_primary_expression): In C++0x mode, a cast operator can
688 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
689 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
690 !GREATER_THAN_IS_OPERATOR_P.
691 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
692 `>>' operators that will become two `>' tokens in C++0x.
693 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
694 mode, allowing it to terminate default arguments.
695 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
696 `>>' like two consecutive `>' tokens.
697 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
698 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
699 ends a template argument.
701 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
703 * decl.c (redeclaration_error_message): Complain when redeclaring
704 a friend function with default template arguments (C++0x mode only).
705 * cp-tree.h (check_default_tmpl_args): Declare.
706 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
707 template arguments in function templates. Add support for checking
708 the default template arguments of friend templates.
709 (push_template_decl_real): Fix call to check_default_tmpl_args.
710 (type_unification_real): If a template parameter has not been
711 deduced but provides a default template argument, substitute into
712 that default template argument.
713 * parser.c (cp_parser_init_declarator): When declaring (but not
714 defining!) a function template in C++0x mode, check for default
717 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
720 * decl.c (grokdeclarator): Deal with cv-qualified function type
721 typedefs in the same way for member and non-member functions.
723 2007-03-26 Dirk Mueller <dmueller@suse.de>
725 * parser.c (cp_parser_member_declaration): Pedwarn
726 about stray semicolons after member declarations.
728 2007-03-26 Paolo Carlini <pcarlini@suse.de>
731 * pt.c (instantiate_decl): Set in_system_header.
733 2007-03-22 Mark Mitchell <mark@codesourcery.com>
735 * cp-tree.h (current_tempalte_parms): Improve documentation.
736 * pt.c (current_template_args): Likewise.
739 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
740 not consume tokens when failing.
742 2007-03-22 Jim Wilson <wilson@specifix.com>
743 Mark Mitchell <mark@codesourcery.com>
746 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
747 consistent with FROM.
749 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
751 * error.c (dump_expr): Handle dependent names that designate types.
752 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
754 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
756 * cp-tree.def, parser.c, pt.c: Fix comment typos.
758 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
760 * cvt.c (cp_convert_and_check) : Define.
761 * cp-tree.h (cp_convert_and_check): Declare.
762 * call.c (convert_conversion_warnings): Rename to
763 conversion_null_warnings. The warning for floating-point to
764 integer is handled by convert_and_check in convert_like_real.
765 (convert_like_real): convert_conversion_warnings was renamed as
766 conversion_null_warnings.
767 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
768 overflow and changes of value during conversion.
770 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
773 * parser.c (cp_parser_statement): If 'namespace' is found, this
774 only can be a namespace alias definition, so parse it now.
775 (cp_parser_namespace_alias_definition): if we find an open brace
776 instead of '=', then this is actually a misplaced namespace
779 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
782 * decl.c (cxx_init_decl_processing): Move command-line options
783 processing to c-opts.c.
785 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
787 * ptree.c (cxx_print_type): Use formatting markup for integers
788 when printing template parameter index/level/orig level.
789 (cxx_print_xnode): Ditto.
790 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
791 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
792 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
794 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
795 rather than a HOST_WIDE_INT.
796 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
797 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
799 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
800 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
801 IN_BASE_INITIALIZER bool bitfields.
802 (struct cp_declarator): Make KIND a 4-bit field. Make
803 PARAMETER_PACK_P a bool bitfield just after KIND.
804 * pt.c (uses_parameter_packs): Destroy the pointer set.
805 (make_pack_expansion): Ditto.
806 (check_for_bare_parameter_packs): Ditto.
807 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
809 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
812 * call.c (convert_default_arg): Instead of copying the node,
815 2007-03-15 Dirk Mueller <dmueller@suse.de>
818 * call.c (convert_conversion_warnings): New..
819 (convert_like_real): .. factored out from here.
820 (convert_conversion_warnings): Add warning about
821 false being converted to NULL in argument passing.
823 2007-03-14 Dirk Mueller <dmueller@suse.de>
825 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
826 (finish_do_body): Warn about empty body in do/while statement.
828 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
830 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
832 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
835 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
838 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
840 * cp/repo.c (init_repo): Initialize random_seed saved options.
841 (finish_repo): Adjust.
843 2007-03-13 Mark Mitchell <mark@codesourcery.com>
846 * Make-lang.in (doc/g++.1): Use $< to specify the location from
849 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
851 * decl.c (compute_array_index_type): New warning flag warn_vla.
853 2007-03-12 Mark Mitchell <mark@codesourcery.com>
856 * call.c (convert_default_arg): Copy non-constant arguments.
858 2007-03-11 Mark Mitchell <mark@codesourcery.com>
861 * parser.c (cp_parser_postfix_expression): Disallow compound
862 literals in constant expressions.
865 * semantics.c (finish_typeof): Use unlowered_expr_type.
867 2007-03-10 Mark Mitchell <mark@codesourcery.com>
870 * cp-tree.h (unlowered_expr_type): New function.
871 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
872 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
873 (unlowered_expr_type): New function.
874 (build_unary_op): Disallow predecrements of bool bitfields.
875 * call.c (build_conditional_expr): Use unlowered_expr_type.
876 * pt.c (type_unification_real): Likewise.
878 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
881 * typeck.c (check_return_expr): Check for bare parameter packs.
882 (comptypes): Compare template parameter packs and
883 type pack expansions.
884 * decl.c (grokdeclarator): Deal with the declaration of function
886 (grokparms): Verify that the (optional) function parameter pack is
887 at the end of the parameter list.
888 (xref_basetypes): Handle pack expansions in the base class.
889 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
890 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
891 (NONTYPE_ARGUMENT_PACK): New.
892 (TYPE_PACK_EXPANSION): New.
893 (EXPR_PACK_EXPANSION): New.
894 (ARGUMENT_PACK_SELECT): New.
895 * cp-objcp-common.c (cp_tree_size): Compute size of
896 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
897 ARGUMENT_PACK_SELECT.
898 * error.c (dump_template_argument): Print template argument packs.
899 (dump_template_argument_list): Ditto.
900 (dump_template_parameter): Dump `...' for template type parameter
902 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
903 (dump_parameters): Print function parameter packs.
904 (dump_template_parms): Print template argument packs.
905 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
906 (maybe_warn_variadic_templates): New.
907 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
908 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
909 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
911 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
912 (write_template_arg): Write argument packs as separate arguments.
913 * cp-tree.h (struct template_parm_index_s): Add flag that
914 indicates that the template parameter is actually a parameter
916 (struct tree_argument_pack_select): New.
917 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
918 (union lang_tree_node): Add argument_pack_select.
919 (FUNCTION_PARAMETER_PACK_P): New.
920 (PACK_EXPANSION_P): New.
921 (PACK_EXPANSION_PATTERN): New.
922 (SET_PACK_EXPANSION_PATTERN): New.
923 (PACK_EXPANSION_PARAMETER_PACKS): New.
924 (ARGUMENT_PACK_P): New.
925 (ARGUMENT_PACK_ARGS): New.
926 (SET_ARGUMENT_PACK_ARGS): New.
927 (ARGUMENT_PACK_INCOMPLETE_P): New.
928 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
929 (TEMPLATE_PARM_PARAMETER_PACK): New.
930 (TEMPLATE_TYPE_PARAMETER_PACK): New.
931 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
932 (ARGUMENT_PACK_SELECT_INDEX): New.
933 (ARGUMENT_PACK_SELECT_ARG): New.
934 (struct cp_declarator): Add parameter_pack_p flag.
935 (maybe_warn_variadic_templates): Declare.
936 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
937 indicate a template parameter pack.
938 (uses_parameter_packs): Declare.
939 (template_parameter_pack_p): Declare.
940 (template_parms_variadic_p): Declare.
941 (make_pack_expansion): Declare.
942 (check_for_bare_parameter_packs): Declare.
943 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
944 sizeof... expressions.
945 (pp_cxx_expression): Print pack expansions and non-type argument
947 (pp_cxx_exception_specification): Print pack expansions.
948 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
949 (pp_cxx_ctor_initializer): Print pack expansions.
950 (pp_cxx_type_id): Print pack expansions.
951 (pp_cxx_template_argument_list): Print argument packs.
952 (pp_cxx_template_parameter): Print ellipsis for template parameter
954 * pt.c (comp_template_parms): Compare template parameter packs.
955 (template_parameter_pack_p): New.
956 (template_parms_variadic_p): New.
957 (template_args_variadic_p): New.
958 (make_ith_pack_parameter_name): New.
959 (struct find_parameter_pack_data): New.
960 (find_parameter_packs_r): New.
961 (uses_parameter_packs): New.
962 (make_pack_expansion): New.
963 (check_for_bare_parameter_packs): New.
964 (expand_template_argument_pack): New.
965 (reduce_template_parm_level): Propagate parameter pack flag.
966 (process_template_parm): Add is_parameter_pack parameter to state
967 when the parameter is actually a parameter pack. Create template
968 parameter packs when is_parameter_pack is true.
969 (current_template_args): The argument for a template parameter
970 pack is an argument pack containing a single pack expansion.
971 (process_partial_specialization): When checking that non-type
972 argument expressions do not involve template parameters, loop over
973 the arguments in argument packs separately.
974 (push_template_decl_real): Check that the type of the declaration
975 does not have any bare parameter packs. Check that primary
976 templates have no more than one parameter pack, and that it comes
977 at the end of the template parameter list.
978 (convert_template_argument): Handle coercions for pack expansion
979 expressions by coercing the pattern then rebuilding the expansion.
980 (coerce_template_parms): When coercing the arguments for a
981 variadic template, pack "extra" arguments into an argument pack.
982 (coerce_template_template_parms): Cannot coerce between parameter
983 packs and non-pack parameters.
984 (template_args_equal): Compare PACK_EXPANSION_P expressions.
985 (comp_template_args): Expand all template arguments packs before
986 comparing template argument lists.
987 (mangle_class_name_for_template): Make argument packs as separate
989 (for_each_template_parm_r): No need to handle BASELINK.
990 (instantiate_class_template): Handle pack expansions in the base
992 (tsubst_pack_expansion): New.
993 (tsubst_template_args): Handle substitutions of argument packs and
994 pack expansion into template argument lists.
995 (tsubst_decl): Expand function parameter packs into separate
997 (tsubst_arg_types): Expand a type pack expansion into separate
999 (tsubst_exception_specification): Handle pack expansions in
1000 exception specifiers.
1001 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1002 replacing a template parameter with its argument. If we encounter
1003 a substitution for an argument pack, just return the parameter
1005 (tsubst_copy): sizeof(X...) returns the number of elements in
1006 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1007 PARM_DECL is a parameter pack.
1008 (tsubst_expr): Expression pack expansions and argument packs
1009 cannot show up here; they will all be handled through function
1010 calls, sizeof, and template argument lists.
1011 (tsubst_copy_and_build): sizeof(X...) returns the number of
1012 elements in parameter pack X. Handle pack expansions in TREE_LIST
1013 and CONSTRUCTOR nodes.
1014 (fn_type_unification): Handle "incomplete" explicit template
1015 argument lists that specify some of the arguments for a template
1017 (type_unification_real): Unify arguments against pack expansions.
1018 (template_parm_level_and_index): New, helper function.
1019 (unify_pack_expansion): New.
1020 (unify): Unify argument packs on an argument-by-argument basis,
1021 handling variadic argument packs as well.
1022 (more_specialized_fn): Handle unification of function parameter
1023 packs. All things being equal, prefer non-variadic function
1024 templates to variadic function templates.
1025 (more_specialized_class): Prefer the variadic class template
1026 partial specialization that binds fewer arguments to a parameter
1028 (regenerate_decl_from_template): Expand function parameter packs
1029 into separate parameters.
1030 (instantiate_decl): Ditto.
1031 (tsubst_initializer_list): Handle pack expansions for base-class
1033 (dependent_type_p_r): Determine dependent types in argument packs
1034 and pack expansions.
1035 (value_dependent_expression_p): Determine value-dependence of
1036 non-type argument packs.
1037 (dependent_template_arg_p): Handle argument packs.
1038 * semantics.c (finish_cond): Check for bare parameter packs.
1039 (finish_expr_stmt): Ditto.
1040 (finish_for_expr): Ditto.
1041 (finish_switch_cond): Ditto.
1042 (finish_mem_initializers): Ditto.
1043 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1045 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1046 * parser.c (make_declarator): Declarator is not an expansion.
1047 (make_pointer_declarator): Transfer parameter pack flag to outer
1049 (make_reference_declarator): Ditto.
1050 (make_ptrmem_declarator): Ditto.
1051 (make_call_declarator): Ditto.
1052 (make_array_declarator): Ditto.
1053 (cp_parser_postfix_expression): Allow pack expansion expressions
1054 in the argument list for a call expression.
1055 (cp_parser_parenthesized_expression_list): Add new parameter
1056 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1057 into separate arguments."
1058 (cp_parser_new_placement): Allow pack expansion expressions.
1059 (cp_parser_new_initializer): Ditto.
1060 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1061 base-class initializer expansion.
1062 (cp_parser_mem_initializer): Ditto.
1063 (cp_parser_template_parameter_list): Keep track of whether the
1064 template parameter is a template parameter pack.
1065 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1066 template parameter pack.
1067 (cp_parser_type_parameter): Ditto.
1068 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1070 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1071 this declarator is a parameter pack.
1072 (cp_parser_parameter_declaration): The ellipsis does not end the
1073 parameter declaration, because it might be a parameter pack. Parse
1074 the ellipsis to indicate a parameter pack.
1075 (cp_parser_initializer): Allow pack expansions.
1076 (cp_parser_initializer_list): Allow ellipsis to create an
1077 initializer expansion.
1078 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1080 (cp_parser_type_id_list): Allow ellipsis to create an exception
1081 specifier expansion.
1082 (cp_parser_attribute_list): Don't allow pack expansions.
1083 (cp_parser_functional_cast): Allow pack expansions.
1084 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1085 compute the length of a parameter pack.
1086 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1087 end a template argument.
1088 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1089 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1092 2007-03-09 Dirk Mueller <dmueller@suse.de>
1094 * cp/call.c (build_new_op): Call warn_logical_operator.
1096 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1099 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1102 * pt.c (any_template_arguments_need_structural_equality_p):
1105 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1107 * decl.c (grokdeclarator): Disable warnings for anonymous
1110 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1112 * typeck2.c (readonly_error): Always emit a hard error.
1113 Remove last argument.
1114 * cp-tree.h (readonly_error): Adjust prototype.
1115 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1116 * typeck.c (build_unary_op): Likewise.
1117 (build_modify_expr): Likewise.
1119 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1122 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1124 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1127 * parser.c (struct cp_parser): New IN_IF_STMT.
1128 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1129 returning if parsing the body of an 'if' statement or issuing an
1130 error and continuing.
1131 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1133 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1135 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1138 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1141 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1143 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1144 Objective-C++. Don't exit early if -shared-libgcc needs to be
1147 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1149 * typeck.c (common_base_type): Delete unused function.
1151 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1153 * Make-lang.in: Add dummy lang.install-pdf target.
1155 2007-03-01 Simon Baldwin <simonb@google.com>
1158 * decl.c (check_tag_decl): Added new warning for typedef ignored
1159 when it precedes an otherwise valid non-typedef declaration.
1161 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1163 * typeck.c (build_function_call): Store converted arguments
1164 in a stack-allocated array instead of building a list.
1165 (convert_arguments): Store arguments in the array passed in as an
1166 argument, and return the actual number of arguments.
1167 * call.c (build_call): Delete, and replace with...
1168 (build_call_n, build_call_a): New.
1169 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1170 (build_over_call): Store converted arguments in a stack-allocated
1171 array instead of building a list.
1172 (build_cxx_call): Pass arguments in an array instead of as a list.
1173 (build_java_interface_fn_ref): Rewrite to avoid constructing
1175 * tree.h: Update declarations to reflect above changes.
1176 * method.c (use_thunk): Use a stack-allocated array to hold
1177 the arguments instead of a list.
1178 * rtti.c (throw_bad_cast): Update call to cxx_call.
1179 (throw_bad_typeid): Likewise.
1180 (build_dynamic_cast_1): Likewise.
1181 * init.c (build_builtin_delete_call): Use build_call_n.
1182 * decl.c (expand_static_init): Likewise.
1183 * except.c (cp_protect_cleanup_actions): Likewise.
1184 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1185 (gimplify_must_not_throw_expr): Likewise.
1186 (cxx_omp_apply_fn): Use build_call_a.
1188 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1190 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1191 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1193 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1195 * cp-tree.h (static_ctors): Remove.
1196 * cp-tree.h (static_dtors): Likewise.
1197 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1198 refactoring of tree_map hierarchy.
1199 (decl_shadowed_for_var_insert): Likewise.
1200 * semantics.c (expand_body): Use c_expand_body.
1201 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1202 * decl2.c (static_ctors): Remove.
1203 (static_dtors): Likewise.
1204 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1205 objc_generate_static_init_call. Do not call static_[cd]tors.
1206 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1208 (cp_write_global_declarations): Likewise.
1210 2007-02-23 Richard Guenther <rguenther@suse.de>
1212 * class.c (note_name_declared_in_class): Make declaration
1213 changes meaning a pedwarn.
1215 2007-02-22 Michael Matz <matz@suse.de>
1218 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1219 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1220 dump_function_decl): Guard emitting outer scopes by new flag.
1221 * cp-lang.c (cxx_dwarf_name): New function.
1222 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1223 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1225 (push_template_decl_real, lookup_template_class): Remove calls
1228 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1230 * call.c (build_new_method_call): Ensure that explicit calls of
1231 destructors have type "void".
1233 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1235 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1236 and -Walways-true with -Waddress.
1237 * cvt.c (convert_to_void): Replace unconditional warning with
1240 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1242 * decl.c, tree.c: Fix comment typos.
1244 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1247 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1248 statement expression if we had an error mark node.
1250 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1251 Brooks Moses <brooks.moses@codesourcery.com>
1252 Lee Millward <lee.millward@codesourcery.com>
1254 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1255 Change class to tcc_vl_exp.
1257 * call.c (build_call): Use build_call_list instead
1259 (build_over_call): Likewise.
1260 (build_new_method_call): Use build_min_non_dep_call_list
1261 instead of build_min_non_dep.
1263 * error.c (dump_call_expr_args): New function.
1264 (dump_aggr_init_expr_args): New function.
1265 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1266 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1268 * cvt.c (convert_to_void): Use build_call_array instead
1269 of build3; use new AGGR_INIT_EXPR accessor macros.
1271 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1272 instead of TREE_CODE_LENGTH.
1274 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1275 AGGR_INIT_EXPR accessor macros.
1277 * cp-gimplify.c (cp_gimplify_init_expr): Use
1278 AGGR_INIT_EXPR_SLOT to set the slot operand.
1280 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1281 (AGGR_INIT_EXPR_SLOT): New macro.
1282 (AGGR_INIT_EXPR_ARG): New macro.
1283 (aggr_init_expr_nargs): New macro.
1284 (AGGR_INIT_EXPR_ARGP): New macro.
1285 (aggr_init_expr_arg_iterator): New.
1286 (init_aggr_init_expr_arg_iterator): New.
1287 (next_aggr_init_expr_arg): New.
1288 (first_aggr_init_expr_arg): New.
1289 (more_aggr_init_expr_args_p): New.
1290 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1291 (stabilize_aggr_init): New declaration.
1292 (build_min_non_dep_call_list): Likewise.
1294 * tree.c (process_aggr_init_operands): New function.
1295 (build_aggr_init_array) New function.
1296 (build_cplus_new): Update to use new CALL_EXPR and
1297 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1298 build_aggr_init_array.
1299 (build_min_non_dep_call_list) New function.
1300 (build_min_nt): Assert input code parameter is not a variable
1301 length expression class.
1302 (build_min, build_min_non_dep): Likewise.
1303 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1304 to check for equality instead of recursing. Handle tcc_vl_exp
1306 (stabilize_call): Update to only handle CALL_EXPRs, not
1307 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1308 (stabilize_aggr_init): New function.
1309 (stabilize_init): Use it.
1311 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1312 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1313 AGGR_INIT_EXPR accessor macros and argument iterators.
1315 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1316 build_vl_exp. Iterate through the operands, recursively
1317 processing each one.
1318 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1319 CALL_EXPR accessor macros.
1320 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1321 tree code classes. Use TREE_OPERAND_LENGTH instead of
1324 * semantics.c (finish_call_expr): Use build_nt_call_list
1325 instead of build_nt.
1326 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1327 accessor macros. Use build_call_array to construct the
1328 CALL_EXPR node instead of build3
1330 * decl2.c (build_offset_ref_call_from_tree): Use
1331 build_nt_call_list and build_min_non_dep_call_list instead
1332 of build_min_nt and build_min_non_dep.
1334 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1335 Use build_nt_call_list instead of build_min_nt.
1337 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1340 * call.c (build_conditional_expr): Improve error message.
1342 2007-02-13 Dirk Mueller <dmueller@suse.de>
1344 * friend.c (do_friend): Annotate warning about friend
1345 declarations in templates with OPT_Wnon_template_friend.
1346 Convert informal message from warning() to inform().
1348 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1349 Mark Mitchell <mark@codesourcery.com>
1352 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1353 instantiations for variables.
1355 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1358 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1359 Check warn_unused_value just once.
1361 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1364 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1365 (fn_type_unificiation): Likewise.
1366 (get_bindings): Likewise.
1368 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1371 * decl.c (finish_function): Use DECL_REPLACEABLE.
1372 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1374 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1376 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1378 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1380 * decl.c (grokvardecl): Don't error if !have_tls.
1381 (grokdeclarator): Likewise.
1382 * parser.c (cp_parser_omp_threadprivate): Likewise.
1384 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1387 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1388 parameters and result decls in omp clauses.
1389 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1392 2007-02-05 Dirk Mueller <dmueller@suse.de>
1395 * parser.c (cp_parser_class_specifier): Always initialize bases.
1397 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1399 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1400 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1401 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1403 * semantics.c (finish_omp_atomic): Store a whole expression node
1404 in operand 1, and integer_zero_node in operand 0, for dependent
1405 OMP_ATOMIC. Rewrite to make flow easier to understand.
1407 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1409 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1411 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1413 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1414 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1416 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1418 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1419 keyword warning to -Wc++0x-compat.
1421 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1423 * decl.c (grokdeclarator): Update documentation.
1425 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1428 * decl.c (grokdeclarator): If __thread is used together with
1429 a storage class other than extern and static, clear thread_p
1430 after issuing diagnostics and fall through to checking the
1433 2007-01-30 Roger Sayle <roger@eyesopen.com>
1435 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1436 calculating the size of an array (to avoid recursive errors).
1438 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1441 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1443 * call.c (convert_like_real): Don't warn when converting to
1446 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1448 * decl.c (pop_label): Replace warning with call to
1449 warn_for_unused_label.
1451 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1454 * semantics.c (finish_pseudo_destructor_expr): Check the
1455 destrutor name by calling check_dtor_name.
1457 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1459 * lex.c (D_CPP0X): Rename.
1461 (reswords): D_CPP0X -> D_CXX0X.
1462 (init_reswords): Ditto.
1463 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1464 of C++0x keywords as identifiers.
1466 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1469 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1472 2007-01-23 Ian Lance Taylor <iant@google.com>
1474 * typeck.c (convert_for_assignment): Only warn about a = b = c
1475 when converting to bool.
1477 2007-01-23 Roger Sayle <roger@eyesopen.com>
1479 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1481 * typeck.c (ignore_overflows): Remove the remaining uses of
1482 TREE_CONSTANT_OVERFLOW.
1484 2007-01-20 Jan Hubicka <jh@suse.cz>
1486 * decl2.c (start_objects, start_static_storage_duration_function):
1487 Do not make the functions uninlinable.
1489 2007-01-17 Ian Lance Taylor <iant@google.com>
1491 * class.c (add_method): Call VEC_reserve_exact rather than passing
1492 a negative size to VEC_reserve.
1494 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1497 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1499 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1502 * decl.c (make_typename_type): If the qualified name is not a
1503 type, issue an error.
1504 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1507 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1509 * rtti.c: Include target.h.
1510 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1511 don't emit typeinfo for fundamental types as weak.
1512 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1514 2007-01-08 Richard Guenther <rguenther@suse.de>
1516 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1518 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1520 * call.c (standard_conversion): Pass flag to
1521 vector_types_convertible_p to disallow emission of note.
1522 * typeck.c (convert_for_assignment): Pass flag to
1523 vector_types_convertible_p to allow emission of note.
1524 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1525 to disallow emission of note.
1527 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1530 * typeck.c (build_binary_op): Call overflow_warning if
1531 TREE_OVERFLOW_P is true for the result and not for any of the
1534 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1537 * class.c (add_method): Don't wait until template
1538 instantiation time to complain about duplicate methods.
1540 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1543 * semantics.c (finish_unary_op_expr): Warn only if result
1544 overflowed and operands did not.
1546 2007-01-05 Ian Lance Taylor <iant@google.com>
1548 * typeck.c (build_binary_op): Warn about comparing a non-weak
1551 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1553 * pt.c (tsubst): Propagate the need for structural equality checks
1554 when reducing the level of template parameters.
1556 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1558 * pt.c: Fix a comment typo.
1560 2007-01-02 Ian Lance Taylor <iant@google.com>
1562 * semantics.c (maybe_convert_cond): Optionally warn when using an
1563 assignment as a condition.
1564 * typeck.c (convert_for_assignment): Optionally warn about
1565 assigning the result of an assignment to a bool.
1567 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1569 * pt.c (canonical_template_parms): Correct typo in comment.
1571 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1573 * typeck.c (structural_comptypes): Renamed from "comptypes".
1574 (comptypes): Use canonical type information to perform fast type
1575 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1576 canonical type comparison returns the same results as we would see
1577 from the current, structural check. Support COMPARE_STRUCTURAL
1578 when we need structural checks.
1579 * decl.c (typename_compare): Fix comment.
1580 (build_typename_type): TYPENAME_TYPE nodes require structural
1581 equality checks, because they resolve different based on the
1583 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1584 require structural equality checks (for now).
1585 (build_ptrmemfunc_type): Build the canonical pointer to member
1587 (compute_array_index_type): Whenever we build a new index type
1588 to represent the size of an array in a template, we need to mark
1589 this index type as requiring structural equality. This goes for
1590 arrays with value-dependent sizes with the current ABI, or all
1592 * tree.c (cplus_array_hash): New.
1593 (struct cplus_array_info): New.
1594 (cplus_array_compare): New.
1595 (cplus_array_htab): New.
1596 (build_cplus_array_type_1): Use a hash table to cache the array
1597 types we build. Build the canonical array type for each array
1599 (cp_build_qualified_type_real): When building a cv-qualified array
1600 type, use the hash table of array types and build canonical array
1602 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1603 use structural equality (for now).
1604 * cp-tree.h (COMPARE_STRUCTURAL): New.
1605 * pt.c (canonical_template_parms): New.
1606 (canonical_type_parameter): New.
1607 (process_template_parm): Find the canonical type parameter.
1608 (lookup_template_class): When we have named the primary template
1609 type, set the canonical type for our template class to the primary
1610 template type. If any of the template arguments need structural
1611 equality checks, the template class needs structural equality
1613 (tsubst): When reducing the level of a template template
1614 parameter, we require structural equality tests for the resulting
1615 parameter because its template parameters have not had their types
1616 canonicalized. When reducing a template type parameter, find the
1617 canonical reduced type parameter.
1618 (any_template_arguments_need_structural_equality_p): New.