1 2007-07-03 Richard Guenther <rguenther@suse.de>
4 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
7 2007-07-02 Simon Baldwin <simonb@google.com>
9 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
10 for inner-style nested forward declarations that don't declare
13 2007-07-02 Jakub Jelinek <jakub@redhat.com>
16 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
17 DECL_P in not a variable and appears more than once error messages.
19 2007-07-01 Ollie Wild <aaw@google.com>
21 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
22 (select_decl): Remove function.
23 (unqualified_namespace_lookup): Populate binding by calling
24 ambiguous_decl. Remove select_decl call.
25 (lookup_qualified_name): Remove select_decl call.
26 * decl.c (lookup_and_check_tag): Check for ambiguous references.
27 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
28 generation when name lookup is ambiguous.
30 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
33 * init.c (build_new_1): Use structural equality on the copy of the
36 2007-06-28 Geoffrey Keating <geoffk@apple.com>
38 * decl2.c (determine_visibility): Implement
39 flag_visibility_ms_compat effect on type info.
40 * decl.c (cxx_init_decl_processing): Implement
41 global effect of flag_visibility_ms_compat.
43 2007-06-28 Geoffrey Keating <geoffk@apple.com>
45 * decl2.c (start_objects): Mark constructor-running function
48 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
51 * decl.c (grokdeclarator): Reset friendp for member functions declared
52 friend of their own class.
54 2007-06-23 Mark Mitchell <mark@codesourcery.com>
56 * decl2.c (determine_visibility): Don't look for dllexport here.
57 (determine_visibility_from_class): Tidy.
59 2007-06-18 Simon Baldwin <simonb@google.com>
62 * parser.c (cp_parser_single_declaration): Added check for storage
63 class other than sc_none in parsed declaration, and a flag to indicate
64 if the call is part of an explicit template specialization parse.
65 * (cp_parser_explicit_specialization): Specialization check flag added
66 to call to cp_parser_single_declaration(), set true.
67 * (cp_parser_template_declaration_after_export): Specialization check
68 flag added to call to cp_parser_single_declaration(), set false.
69 * pt.c (check_explicit_specialization): Added code to copy visiblity
70 and linkage from the templated function to the explicit specialization.
72 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
74 * typeck.c (build_binary_op): For templates build the
75 expression in pieces to avoid the assert in build2_stat.
76 (get_member_function_from_ptrfunc):
77 Change over to using POINTER_PLUS_EXPR and convert
78 the second operand to sizetype.
79 * typeck2.c (build_m_component_ref): Likewise.
80 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
81 instead of PLUS_EXPR for pointers.
82 (build_new_1): Likewise.
83 (build_vec_delete_1): Likewise.
84 (build_vec_delete): Likewise.
85 * class.c (build_base_path): Likewise.
86 (build_base_path): Likewise.
87 (convert_to_base_statically): Likewise.
88 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
89 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
91 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
92 instead of PLUS_EXPR for pointers.
93 * call.c (build_special_member_call): Likewise.
94 * rtti.c (build_headof): Likewise.
95 Use sizetype instead of ptrdiff_type_node.
96 (tinfo_base_init): Create a POINTER_PLUS_EXPR
97 instead of PLUS_EXPR for pointers.
98 * except.c (expand_start_catch_block): Do a
99 NEGATIVE and then a POINTER_PLUS_EXPR instead
101 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
102 PLUS_EXPR on pointer types over to use
103 POINTER_PLUS_EXPR and remove the conversion
104 to the pointer types.
105 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
106 adding to a pointer type. Use size_int instead of
107 ssize_int. Convert the index to sizetype before
108 adding it to the pointer.
110 2007-06-15 Mark Mitchell <mark@codesourcery.com>
112 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
113 (DECL_ANON_UNION_VAR_P): New macro.
114 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
115 than DECL_VAR_MARKED_P, to keep track of which variables we have
117 * decl.c (redeclaration_error_message): Complain about redeclaring
118 anonymous union members at namespace scope.
119 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
121 2007-06-14 Geoff Keating <geoffk@apple.com>
123 * decl2.c (determine_visibility): Ensure that functions with
124 hidden types as parameters are hidden.
127 * decl2.c (determine_visibility): Remove duplicate code for
130 2007-06-12 Ian Lance Taylor <iant@google.com>
133 * init.c (avoid_placement_new_aliasing): New static function.
134 (build_new_1): Call it.
136 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
138 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
139 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
141 2007-06-08 Jakub Jelinek <jakub@redhat.com>
144 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
145 on init, the non-decl cond operand and increment value.
147 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
150 * decl.c (check_initializer): Report an error when a brace enclosed
151 initializer is used for a non-aggregate type in C++98.
152 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
154 (grokdeclarator): Likewise.
155 (move_fn_p): Likewise.
156 * typeck.c (check_return_expr): Likewise.
157 * call.c (reference_binding): Likewise.
158 * error.c (cp_cpp_error): Likewise.
159 * pt.c (check_default_tmpl_args): Likewise.
161 * lex.c (init_reswords): Likewise.
162 * parser.c (p_parser_primary_expression): Likewise.
163 (TOKEN_PRECEDENCE): Likewise.
164 (cp_parser_init_declarator): Likewise.
165 (cp_parser_ptr_operator): Likewise.
166 (cp_parser_parameter_declaration): Likewise.
167 (cp_parser_enclosed_template_argument_list): Likewise.
168 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
169 (cp_parser_next_token_ends_template_argument_p): Likewise.
171 2007-06-04 Simon Baldwin <simonb@google.com>
173 * decl.c (grokdeclarator): Readability change. Moved case labels
174 into direct switch statement scope.
176 2007-06-04 Paolo Carlini <pcarlini@suse.de>
178 * call.c (convert_like_real): Remove pointless code.
180 2007-05-31 Mark Mitchell <mark@codesourcery.com>
182 * decl.c (get_atexit_fn_ptr_type): New function.
183 (get_atexit_node): Use it.
184 (start_cleanup_fn): Likewise.
185 (register_dtor_fn): Use the object's destructor, instead of a
186 separate cleanup function, where possible.
187 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
188 (atexit_fn_ptr_type_node): New macro.
189 * decl2.c (build_cleanup): Use build_address.
191 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
193 * typeck.c (build_binary_op): Include types in error.
195 2007-05-31 Jakub Jelinek <jakub@redhat.com>
198 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
199 needs runtime initialization.
201 2007-05-31 Paolo Carlini <pcarlini@suse.de>
204 * semantics.c (finish_trait_expr): Complete the types.
206 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
207 Douglas Gregor <doug.gregor@gmail.com>
208 Pedro Lamarao <pedro.lamarao@mndfck.org>
209 Howard Hinnant <howard.hinnant@gmail.com>
213 * typeck.c (comptypes): Don't consider rvalue and lvalue
214 reference types to be equivalent.
215 (check_return_expr): Move from certain lvalues when returning
217 * decl.c (grokdeclarator): Implement reference collapsing.
218 (copy_fn_p): Don't consider constructors taking rvalue references
219 to be copy constructors.
221 * call.c (conversion): New "rvaluedness_matches_p" member.
222 (convert_class_to_reference): Require reference type as first
223 parameter instead of base type.
224 (reference_binding): Add logic to handle rvalue references.
225 (implicit_conversion): Update inaccurate comment.
226 (convert_like_real): Disable creation of temporaries that are
227 impossible to initialize for types with move constructors.
228 (build_over_call): Elide move constructors when possible.
229 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
230 (maybe_handle_ref_bind): Return conversion instead of type node.
231 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
232 determine preferred conversion sequences.
233 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
234 (LOOKUP_PREFER_RVALUE): New.
235 (DECL_MOVE_CONSTRUCTOR_P): New.
236 (struct cp_declarator): Add "reference" member for reference
237 types, with new "rvalue_ref" flag.
238 (cp_build_reference_type): Declare.
239 (move_fn_p): Declare.
240 * error.c (dump_type_prefix): Format rvalue reference types
241 correctly in error messages.
242 * except.c (build_throw): Move from certain lvalues when
244 * mangle.c (write_type): Mangle rvalue references differently
245 than regular references.
246 * parser.c (make_reference_declarator): Add boolean parameter for
248 (cp_parser_make_indirect_declarator): New.
249 (cp_parser_new_declarator_opt): Call
250 cp_parser_make_indirect_declarator.
251 (cp_parser_conversion_declarator_opt): Ditto.
252 (cp_parser_declarator): Ditto.
253 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
255 * pt.c (tsubst): Implement reference collapsing.
256 (maybe_adjust_types_for_deduction): Implement special template
257 parameter deduction rule for rvalue references.
258 (type_unification_real): Update calls to
259 maybe_adjust_types_for_deduction.
260 (try_one_overload): Ditto.
261 (unify_pack_expansion): Ditto.
262 * tree.c (lvalue_p_1): Handle rvalue reference types.
263 (cp_build_reference_type): New.
265 2007-05-30 Jakub Jelinek <jakub@redhat.com>
268 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
269 variables that need runtime initialization.
271 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
274 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
275 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
276 case POSTDECREMENT_EXPR>): Return the error_mark_node
277 if either the real or imaginary parts would an
280 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
281 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
284 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
285 token is a closing brace, false if there are no tokens left.
286 (cp_parser_namespace_alias_definition): Only consume the next token if
287 it is a closing brace.
289 * parser.c (cp_parser_class_specifier): Likewise.
291 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
293 * semantics.c (finish_member_declaration): Fix a typo in the
296 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
308 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
309 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
310 * pt.c (check_for_bare_parameter_packs): Return bool indicated
311 whether everything was okay. Fix indentation.
312 (push_template_decl_real): Check for bare parameter packs in
313 function parameters; where errors occur, mark the parameter types
314 with ERROR_MARK_NODEs to avert ICEs.
315 (coerce_template_parameter_pack): New.
316 (coerce_template_parms): Moved parameter pack coercion into
317 coerce_template_parameter_pack, and permit it anywhere in the
318 template parameter list (not just at the end). Parameter and
319 argument indices can vary (somewhat) separately now, so add
320 PARM_IDX and ARG_IDX.
321 (fn_type_unification): Don't set an argument pack as incomplete if
322 no argument pack was deduced.
323 (type_unification_real): If a type parameter is a parameter pack
324 and has not otherwise been deduced, it will be deduced to an empty
326 (more_specialized_fn): Use the actual lengths of the argument
327 lists when comparing against expansions.
328 * semantics.c (finish_member_declaration): If a field's type has
329 bare parameter packs, error and set its type to ERROR_MARK_NODE.
331 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
334 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
336 2007-05-22 Ollie Wild <aaw@google.com>
338 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
339 (unqualified_namespace_lookup): Adds check for hidden types.
341 2007-05-22 Ollie Wild <aaw@google.com>
343 * decl.c (duplicate_decls): Verify namespace names are unique.
345 2007-05-21 Mark Mitchell <mark@codesourcery.com>
347 * decl.c (cxx_maybe_build_cleanup): Handle
348 __attribute__((cleanup)).
350 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
352 * cvt.c (cp_convert_and_check): Don't check warnings if the
355 2007-05-18 Geoffrey Keating <geoffk@apple.com>
357 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
359 2007-05-14 Paolo Carlini <pcarlini@suse.de>
362 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
363 type only if is a class type (5.2.8/4).
365 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
367 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
368 * decl.c (grokdeclarator): Use unsigned_type_for instead of
369 c_common_unsigned_type.
371 2007-05-11 Silvius Rus <rus@google.com>
373 * cp/typeck.c (build_indirect_ref): Add call to
374 strict_aliasing_warning.
375 (build_reinterpret_cast_1): Condition call to
376 strict_aliasing_warning.
378 2007-05-11 Jan Hubicka <jh@suse.cz>
380 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
381 * decl2.c (start_objects): ctors and dtors are no longer public.
382 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
384 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
386 * typeck.c (build_unary_op): Remove code that used to
387 handle non lvalue increments/decrements.
389 2007-05-07 Mike Stump <mrs@apple.com>
391 * parser.c (check_empty_body): Add.
392 (cp_parser_iteration_statement): Add call to check_empty_body.
394 2007-05-05 Geoffrey Keating <geoffk@apple.com>
397 * mangle.c (write_mangled_name): Mangle static variable names.
398 (write_unqualified_name): Use local-source-name for
399 namespace-scope static variables.
401 2007-05-04 Dirk Mueller <dmueller@suse.de>
403 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
406 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
409 * decl2.c (constrain_class_visibility):
410 Use strip_pointer_or_array_types instead of strip_array_types.
412 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
415 * decl.c (reshape_init_r): Don't reshape the first element if it
416 is a pointer to member function.
418 2007-04-27 Simon Baldwin <simonb@google.com>
420 * decl.c (grokparms): Changed message format from %qD to %qE.
422 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
424 * error.c (maybe_warn_variadic_templates): Variadic templates are
425 now in C++0x, so only warn about them in C++98 mode.
427 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
430 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
431 integeral types from vectors types.
433 2007-04-26 Jakub Jelinek <jakub@redhat.com>
436 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
437 for type dependent OMP_CLAUSE_DECLs.
439 2007-04-24 Mark Mitchell <mark@codesourcery.com>
442 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
443 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
444 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
445 * init.c (build_zero_init): Adjust, as
446 COMPLEX_TYPE is now a SCALAR_TYPE.
447 * typeck2.c (digest_init): Allow brace-enclosed initializers for
448 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
450 2007-04-25 Paolo Carlini <pcarlini@suse.de>
452 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
453 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
454 (trait_expr_value): Adjust.
456 2007-04-23 Simon Baldwin <simonb@google.com>
458 * decl.c (grokparms): Added new error for duplicate function
459 parameters names in function prototypes, to match gcc behavior.
461 2007-04-23 Jan Hubicka <jh@suse.cz>
463 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
466 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
468 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
469 instead of checking GIMPLE_STMT_P in chain_next.
471 2007-04-17 Mark Mitchell <mark@codesourcery.com>
474 * call.c (convert_for_arg_passing): Convert bitfields to their
477 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
480 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
482 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
486 * cp/decl2.c (constrain_class_visibility):
487 Do not warn about the use of anonymous namespace in the main input file.
489 2007-04-15 Mark Mitchell <mark@codesourcery.com>
491 * cp-tree.h (current_template_parms): Fix typo in comment.
493 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
495 * cp-tree.h, error.c: Fix comment typos.
497 2007-04-13 Jason Merrill <jason@redhat.com>
500 * call.c (reference_binding): Add c_cast_p parm. If true,
501 add quals to TO as needed to make it reference-compatible.
503 2007-04-11 Jan Hubicka <jh@suse.cz>
505 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
506 that we are not processing template_decl.
508 2007-04-09 Mark Mitchell <mark@codesourcery.com>
511 * class.c (build_base_path): Ensure that the converted pointer has
512 the same cv-qualification as the input.
514 2007-04-09 Paolo Carlini <pcarlini@suse.de>
516 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
518 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
520 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
522 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
523 * tree.c (cp_add_pending_fn_decls): Remove.
524 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
526 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
528 Revert change removing staticp.
530 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
532 * cp-objcp-common.c (cxx_staticp): Remove.
533 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
534 * cp-tree.h (cxx_staticp):
536 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
538 * class.c (check_for_override): Don't remove dllmport attribute
541 2007-04-03 Jakub Jelinek <jakub@redhat.com>
544 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
545 type issue error and return early.
547 2007-03-30 Jason Merrill <jason@redhat.com>
550 * typeck.c (cp_type_readonly): New fn.
551 * cp-tree.h: Declare it.
552 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
553 (cp_finish_decl): Not here.
555 2007-03-31 Richard Guenther <rguenther@suse.de>
557 * optimize.c (maybe_clone_body): Replace splay-tree usage by
560 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
565 * parser.c (declarator_can_be_parameter_pack): New.
566 (cp_parser_template_parameter): Only parse the `...' if the
567 declarator can be a parameter pack.
568 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
570 * pt.c (find_parameter_packs_r): Look into the bounds on integer
571 types (they could be used as array bounds).
572 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
573 (tsubst_pack_expansion): Handle failure to expand parameter
576 2007-03-30 Paolo Carlini <pcarlini@suse.de>
579 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
580 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
581 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
582 (CLASS_TYPE_NON_UNION_P): Add.
583 (struct lang_type_class): Add has_complex_dflt.
584 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
585 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
586 * cp-tree.def: Add TRAIT_EXPR.
587 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
588 * lex.c (struct resword): Add __has_nothrow_assign,
589 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
590 __has_trivial_constructor, __has_trivial_copy,
591 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
592 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
593 __is_pod, __is_polymorphic, __is_union.
594 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
595 (cp_parser_trait_expr): New.
596 * semantics.c (finish_trait_expr, trait_expr_value
597 classtype_has_nothrow_copy_or_assign_p): New.
598 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
600 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
601 * class.c (check_bases, check_field_decl, check_bases_and_members):
602 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
603 * pt.c (uses_template_parms, tsubst_copy_and_build,
604 value_dependent_expression_p, type_dependent_expression_p): Deal with
606 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
608 2007-03-29 Richard Guenther <rguenther@suse.de>
610 * tree.c (cp_walk_subtrees): Do not set input_location.
612 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
615 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
618 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
620 * parser.c (struct cp_parser): Update comment for
621 greater_than_is_operator_p.
622 (cp_parser_primary_expression): In C++0x mode, a cast operator can
623 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
624 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
625 !GREATER_THAN_IS_OPERATOR_P.
626 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
627 `>>' operators that will become two `>' tokens in C++0x.
628 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
629 mode, allowing it to terminate default arguments.
630 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
631 `>>' like two consecutive `>' tokens.
632 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
633 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
634 ends a template argument.
636 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
638 * decl.c (redeclaration_error_message): Complain when redeclaring
639 a friend function with default template arguments (C++0x mode only).
640 * cp-tree.h (check_default_tmpl_args): Declare.
641 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
642 template arguments in function templates. Add support for checking
643 the default template arguments of friend templates.
644 (push_template_decl_real): Fix call to check_default_tmpl_args.
645 (type_unification_real): If a template parameter has not been
646 deduced but provides a default template argument, substitute into
647 that default template argument.
648 * parser.c (cp_parser_init_declarator): When declaring (but not
649 defining!) a function template in C++0x mode, check for default
652 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
655 * decl.c (grokdeclarator): Deal with cv-qualified function type
656 typedefs in the same way for member and non-member functions.
658 2007-03-26 Dirk Mueller <dmueller@suse.de>
660 * parser.c (cp_parser_member_declaration): Pedwarn
661 about stray semicolons after member declarations.
663 2007-03-26 Paolo Carlini <pcarlini@suse.de>
666 * pt.c (instantiate_decl): Set in_system_header.
668 2007-03-22 Mark Mitchell <mark@codesourcery.com>
670 * cp-tree.h (current_tempalte_parms): Improve documentation.
671 * pt.c (current_template_args): Likewise.
674 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
675 not consume tokens when failing.
677 2007-03-22 Jim Wilson <wilson@specifix.com>
678 Mark Mitchell <mark@codesourcery.com>
681 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
682 consistent with FROM.
684 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
686 * error.c (dump_expr): Handle dependent names that designate types.
687 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
689 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
691 * cp-tree.def, parser.c, pt.c: Fix comment typos.
693 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
695 * cvt.c (cp_convert_and_check) : Define.
696 * cp-tree.h (cp_convert_and_check): Declare.
697 * call.c (convert_conversion_warnings): Rename to
698 conversion_null_warnings. The warning for floating-point to
699 integer is handled by convert_and_check in convert_like_real.
700 (convert_like_real): convert_conversion_warnings was renamed as
701 conversion_null_warnings.
702 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
703 overflow and changes of value during conversion.
705 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
708 * parser.c (cp_parser_statement): If 'namespace' is found, this
709 only can be a namespace alias definition, so parse it now.
710 (cp_parser_namespace_alias_definition): if we find an open brace
711 instead of '=', then this is actually a misplaced namespace
714 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
717 * decl.c (cxx_init_decl_processing): Move command-line options
718 processing to c-opts.c.
720 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
722 * ptree.c (cxx_print_type): Use formatting markup for integers
723 when printing template parameter index/level/orig level.
724 (cxx_print_xnode): Ditto.
725 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
726 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
727 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
729 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
730 rather than a HOST_WIDE_INT.
731 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
732 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
734 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
735 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
736 IN_BASE_INITIALIZER bool bitfields.
737 (struct cp_declarator): Make KIND a 4-bit field. Make
738 PARAMETER_PACK_P a bool bitfield just after KIND.
739 * pt.c (uses_parameter_packs): Destroy the pointer set.
740 (make_pack_expansion): Ditto.
741 (check_for_bare_parameter_packs): Ditto.
742 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
744 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
747 * call.c (convert_default_arg): Instead of copying the node,
750 2007-03-15 Dirk Mueller <dmueller@suse.de>
753 * call.c (convert_conversion_warnings): New..
754 (convert_like_real): .. factored out from here.
755 (convert_conversion_warnings): Add warning about
756 false being converted to NULL in argument passing.
758 2007-03-14 Dirk Mueller <dmueller@suse.de>
760 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
761 (finish_do_body): Warn about empty body in do/while statement.
763 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
765 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
767 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
770 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
773 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
775 * cp/repo.c (init_repo): Initialize random_seed saved options.
776 (finish_repo): Adjust.
778 2007-03-13 Mark Mitchell <mark@codesourcery.com>
781 * Make-lang.in (doc/g++.1): Use $< to specify the location from
784 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
786 * decl.c (compute_array_index_type): New warning flag warn_vla.
788 2007-03-12 Mark Mitchell <mark@codesourcery.com>
791 * call.c (convert_default_arg): Copy non-constant arguments.
793 2007-03-11 Mark Mitchell <mark@codesourcery.com>
796 * parser.c (cp_parser_postfix_expression): Disallow compound
797 literals in constant expressions.
800 * semantics.c (finish_typeof): Use unlowered_expr_type.
802 2007-03-10 Mark Mitchell <mark@codesourcery.com>
805 * cp-tree.h (unlowered_expr_type): New function.
806 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
807 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
808 (unlowered_expr_type): New function.
809 (build_unary_op): Disallow predecrements of bool bitfields.
810 * call.c (build_conditional_expr): Use unlowered_expr_type.
811 * pt.c (type_unification_real): Likewise.
813 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
816 * typeck.c (check_return_expr): Check for bare parameter packs.
817 (comptypes): Compare template parameter packs and
818 type pack expansions.
819 * decl.c (grokdeclarator): Deal with the declaration of function
821 (grokparms): Verify that the (optional) function parameter pack is
822 at the end of the parameter list.
823 (xref_basetypes): Handle pack expansions in the base class.
824 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
825 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
826 (NONTYPE_ARGUMENT_PACK): New.
827 (TYPE_PACK_EXPANSION): New.
828 (EXPR_PACK_EXPANSION): New.
829 (ARGUMENT_PACK_SELECT): New.
830 * cp-objcp-common.c (cp_tree_size): Compute size of
831 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
832 ARGUMENT_PACK_SELECT.
833 * error.c (dump_template_argument): Print template argument packs.
834 (dump_template_argument_list): Ditto.
835 (dump_template_parameter): Dump `...' for template type parameter
837 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
838 (dump_parameters): Print function parameter packs.
839 (dump_template_parms): Print template argument packs.
840 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
841 (maybe_warn_variadic_templates): New.
842 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
843 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
844 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
846 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
847 (write_template_arg): Write argument packs as separate arguments.
848 * cp-tree.h (struct template_parm_index_s): Add flag that
849 indicates that the template parameter is actually a parameter
851 (struct tree_argument_pack_select): New.
852 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
853 (union lang_tree_node): Add argument_pack_select.
854 (FUNCTION_PARAMETER_PACK_P): New.
855 (PACK_EXPANSION_P): New.
856 (PACK_EXPANSION_PATTERN): New.
857 (SET_PACK_EXPANSION_PATTERN): New.
858 (PACK_EXPANSION_PARAMETER_PACKS): New.
859 (ARGUMENT_PACK_P): New.
860 (ARGUMENT_PACK_ARGS): New.
861 (SET_ARGUMENT_PACK_ARGS): New.
862 (ARGUMENT_PACK_INCOMPLETE_P): New.
863 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
864 (TEMPLATE_PARM_PARAMETER_PACK): New.
865 (TEMPLATE_TYPE_PARAMETER_PACK): New.
866 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
867 (ARGUMENT_PACK_SELECT_INDEX): New.
868 (ARGUMENT_PACK_SELECT_ARG): New.
869 (struct cp_declarator): Add parameter_pack_p flag.
870 (maybe_warn_variadic_templates): Declare.
871 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
872 indicate a template parameter pack.
873 (uses_parameter_packs): Declare.
874 (template_parameter_pack_p): Declare.
875 (template_parms_variadic_p): Declare.
876 (make_pack_expansion): Declare.
877 (check_for_bare_parameter_packs): Declare.
878 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
879 sizeof... expressions.
880 (pp_cxx_expression): Print pack expansions and non-type argument
882 (pp_cxx_exception_specification): Print pack expansions.
883 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
884 (pp_cxx_ctor_initializer): Print pack expansions.
885 (pp_cxx_type_id): Print pack expansions.
886 (pp_cxx_template_argument_list): Print argument packs.
887 (pp_cxx_template_parameter): Print ellipsis for template parameter
889 * pt.c (comp_template_parms): Compare template parameter packs.
890 (template_parameter_pack_p): New.
891 (template_parms_variadic_p): New.
892 (template_args_variadic_p): New.
893 (make_ith_pack_parameter_name): New.
894 (struct find_parameter_pack_data): New.
895 (find_parameter_packs_r): New.
896 (uses_parameter_packs): New.
897 (make_pack_expansion): New.
898 (check_for_bare_parameter_packs): New.
899 (expand_template_argument_pack): New.
900 (reduce_template_parm_level): Propagate parameter pack flag.
901 (process_template_parm): Add is_parameter_pack parameter to state
902 when the parameter is actually a parameter pack. Create template
903 parameter packs when is_parameter_pack is true.
904 (current_template_args): The argument for a template parameter
905 pack is an argument pack containing a single pack expansion.
906 (process_partial_specialization): When checking that non-type
907 argument expressions do not involve template parameters, loop over
908 the arguments in argument packs separately.
909 (push_template_decl_real): Check that the type of the declaration
910 does not have any bare parameter packs. Check that primary
911 templates have no more than one parameter pack, and that it comes
912 at the end of the template parameter list.
913 (convert_template_argument): Handle coercions for pack expansion
914 expressions by coercing the pattern then rebuilding the expansion.
915 (coerce_template_parms): When coercing the arguments for a
916 variadic template, pack "extra" arguments into an argument pack.
917 (coerce_template_template_parms): Cannot coerce between parameter
918 packs and non-pack parameters.
919 (template_args_equal): Compare PACK_EXPANSION_P expressions.
920 (comp_template_args): Expand all template arguments packs before
921 comparing template argument lists.
922 (mangle_class_name_for_template): Make argument packs as separate
924 (for_each_template_parm_r): No need to handle BASELINK.
925 (instantiate_class_template): Handle pack expansions in the base
927 (tsubst_pack_expansion): New.
928 (tsubst_template_args): Handle substitutions of argument packs and
929 pack expansion into template argument lists.
930 (tsubst_decl): Expand function parameter packs into separate
932 (tsubst_arg_types): Expand a type pack expansion into separate
934 (tsubst_exception_specification): Handle pack expansions in
935 exception specifiers.
936 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
937 replacing a template parameter with its argument. If we encounter
938 a substitution for an argument pack, just return the parameter
940 (tsubst_copy): sizeof(X...) returns the number of elements in
941 parameter pack X. See through ARGUMENT_PACK_SELECT when the
942 PARM_DECL is a parameter pack.
943 (tsubst_expr): Expression pack expansions and argument packs
944 cannot show up here; they will all be handled through function
945 calls, sizeof, and template argument lists.
946 (tsubst_copy_and_build): sizeof(X...) returns the number of
947 elements in parameter pack X. Handle pack expansions in TREE_LIST
948 and CONSTRUCTOR nodes.
949 (fn_type_unification): Handle "incomplete" explicit template
950 argument lists that specify some of the arguments for a template
952 (type_unification_real): Unify arguments against pack expansions.
953 (template_parm_level_and_index): New, helper function.
954 (unify_pack_expansion): New.
955 (unify): Unify argument packs on an argument-by-argument basis,
956 handling variadic argument packs as well.
957 (more_specialized_fn): Handle unification of function parameter
958 packs. All things being equal, prefer non-variadic function
959 templates to variadic function templates.
960 (more_specialized_class): Prefer the variadic class template
961 partial specialization that binds fewer arguments to a parameter
963 (regenerate_decl_from_template): Expand function parameter packs
964 into separate parameters.
965 (instantiate_decl): Ditto.
966 (tsubst_initializer_list): Handle pack expansions for base-class
968 (dependent_type_p_r): Determine dependent types in argument packs
970 (value_dependent_expression_p): Determine value-dependence of
971 non-type argument packs.
972 (dependent_template_arg_p): Handle argument packs.
973 * semantics.c (finish_cond): Check for bare parameter packs.
974 (finish_expr_stmt): Ditto.
975 (finish_for_expr): Ditto.
976 (finish_switch_cond): Ditto.
977 (finish_mem_initializers): Ditto.
978 * name-lookup.c (arg_assoc_type): Handle pack expansions and
980 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
981 * parser.c (make_declarator): Declarator is not an expansion.
982 (make_pointer_declarator): Transfer parameter pack flag to outer
984 (make_reference_declarator): Ditto.
985 (make_ptrmem_declarator): Ditto.
986 (make_call_declarator): Ditto.
987 (make_array_declarator): Ditto.
988 (cp_parser_postfix_expression): Allow pack expansion expressions
989 in the argument list for a call expression.
990 (cp_parser_parenthesized_expression_list): Add new parameter
991 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
992 into separate arguments."
993 (cp_parser_new_placement): Allow pack expansion expressions.
994 (cp_parser_new_initializer): Ditto.
995 (cp_parser_mem_initializer_list): Allow ellipsis to create a
996 base-class initializer expansion.
997 (cp_parser_mem_initializer): Ditto.
998 (cp_parser_template_parameter_list): Keep track of whether the
999 template parameter is a template parameter pack.
1000 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1001 template parameter pack.
1002 (cp_parser_type_parameter): Ditto.
1003 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1005 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1006 this declarator is a parameter pack.
1007 (cp_parser_parameter_declaration): The ellipsis does not end the
1008 parameter declaration, because it might be a parameter pack. Parse
1009 the ellipsis to indicate a parameter pack.
1010 (cp_parser_initializer): Allow pack expansions.
1011 (cp_parser_initializer_list): Allow ellipsis to create an
1012 initializer expansion.
1013 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1015 (cp_parser_type_id_list): Allow ellipsis to create an exception
1016 specifier expansion.
1017 (cp_parser_attribute_list): Don't allow pack expansions.
1018 (cp_parser_functional_cast): Allow pack expansions.
1019 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1020 compute the length of a parameter pack.
1021 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1022 end a template argument.
1023 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1024 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1027 2007-03-09 Dirk Mueller <dmueller@suse.de>
1029 * cp/call.c (build_new_op): Call warn_logical_operator.
1031 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1034 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1037 * pt.c (any_template_arguments_need_structural_equality_p):
1040 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1042 * decl.c (grokdeclarator): Disable warnings for anonymous
1045 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1047 * typeck2.c (readonly_error): Always emit a hard error.
1048 Remove last argument.
1049 * cp-tree.h (readonly_error): Adjust prototype.
1050 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1051 * typeck.c (build_unary_op): Likewise.
1052 (build_modify_expr): Likewise.
1054 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1057 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1059 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1062 * parser.c (struct cp_parser): New IN_IF_STMT.
1063 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1064 returning if parsing the body of an 'if' statement or issuing an
1065 error and continuing.
1066 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1068 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1070 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1073 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1076 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1078 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1079 Objective-C++. Don't exit early if -shared-libgcc needs to be
1082 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1084 * typeck.c (common_base_type): Delete unused function.
1086 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1088 * Make-lang.in: Add dummy lang.install-pdf target.
1090 2007-03-01 Simon Baldwin <simonb@google.com>
1093 * decl.c (check_tag_decl): Added new warning for typedef ignored
1094 when it precedes an otherwise valid non-typedef declaration.
1096 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1098 * typeck.c (build_function_call): Store converted arguments
1099 in a stack-allocated array instead of building a list.
1100 (convert_arguments): Store arguments in the array passed in as an
1101 argument, and return the actual number of arguments.
1102 * call.c (build_call): Delete, and replace with...
1103 (build_call_n, build_call_a): New.
1104 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1105 (build_over_call): Store converted arguments in a stack-allocated
1106 array instead of building a list.
1107 (build_cxx_call): Pass arguments in an array instead of as a list.
1108 (build_java_interface_fn_ref): Rewrite to avoid constructing
1110 * tree.h: Update declarations to reflect above changes.
1111 * method.c (use_thunk): Use a stack-allocated array to hold
1112 the arguments instead of a list.
1113 * rtti.c (throw_bad_cast): Update call to cxx_call.
1114 (throw_bad_typeid): Likewise.
1115 (build_dynamic_cast_1): Likewise.
1116 * init.c (build_builtin_delete_call): Use build_call_n.
1117 * decl.c (expand_static_init): Likewise.
1118 * except.c (cp_protect_cleanup_actions): Likewise.
1119 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1120 (gimplify_must_not_throw_expr): Likewise.
1121 (cxx_omp_apply_fn): Use build_call_a.
1123 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1125 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1126 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1128 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1130 * cp-tree.h (static_ctors): Remove.
1131 * cp-tree.h (static_dtors): Likewise.
1132 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1133 refactoring of tree_map hierarchy.
1134 (decl_shadowed_for_var_insert): Likewise.
1135 * semantics.c (expand_body): Use c_expand_body.
1136 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1137 * decl2.c (static_ctors): Remove.
1138 (static_dtors): Likewise.
1139 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1140 objc_generate_static_init_call. Do not call static_[cd]tors.
1141 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1143 (cp_write_global_declarations): Likewise.
1145 2007-02-23 Richard Guenther <rguenther@suse.de>
1147 * class.c (note_name_declared_in_class): Make declaration
1148 changes meaning a pedwarn.
1150 2007-02-22 Michael Matz <matz@suse.de>
1153 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1154 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1155 dump_function_decl): Guard emitting outer scopes by new flag.
1156 * cp-lang.c (cxx_dwarf_name): New function.
1157 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1158 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1160 (push_template_decl_real, lookup_template_class): Remove calls
1163 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1165 * call.c (build_new_method_call): Ensure that explicit calls of
1166 destructors have type "void".
1168 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1170 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1171 and -Walways-true with -Waddress.
1172 * cvt.c (convert_to_void): Replace unconditional warning with
1175 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1177 * decl.c, tree.c: Fix comment typos.
1179 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1182 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1183 statement expression if we had an error mark node.
1185 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1186 Brooks Moses <brooks.moses@codesourcery.com>
1187 Lee Millward <lee.millward@codesourcery.com>
1189 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1190 Change class to tcc_vl_exp.
1192 * call.c (build_call): Use build_call_list instead
1194 (build_over_call): Likewise.
1195 (build_new_method_call): Use build_min_non_dep_call_list
1196 instead of build_min_non_dep.
1198 * error.c (dump_call_expr_args): New function.
1199 (dump_aggr_init_expr_args): New function.
1200 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1201 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1203 * cvt.c (convert_to_void): Use build_call_array instead
1204 of build3; use new AGGR_INIT_EXPR accessor macros.
1206 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1207 instead of TREE_CODE_LENGTH.
1209 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1210 AGGR_INIT_EXPR accessor macros.
1212 * cp-gimplify.c (cp_gimplify_init_expr): Use
1213 AGGR_INIT_EXPR_SLOT to set the slot operand.
1215 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1216 (AGGR_INIT_EXPR_SLOT): New macro.
1217 (AGGR_INIT_EXPR_ARG): New macro.
1218 (aggr_init_expr_nargs): New macro.
1219 (AGGR_INIT_EXPR_ARGP): New macro.
1220 (aggr_init_expr_arg_iterator): New.
1221 (init_aggr_init_expr_arg_iterator): New.
1222 (next_aggr_init_expr_arg): New.
1223 (first_aggr_init_expr_arg): New.
1224 (more_aggr_init_expr_args_p): New.
1225 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1226 (stabilize_aggr_init): New declaration.
1227 (build_min_non_dep_call_list): Likewise.
1229 * tree.c (process_aggr_init_operands): New function.
1230 (build_aggr_init_array) New function.
1231 (build_cplus_new): Update to use new CALL_EXPR and
1232 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1233 build_aggr_init_array.
1234 (build_min_non_dep_call_list) New function.
1235 (build_min_nt): Assert input code parameter is not a variable
1236 length expression class.
1237 (build_min, build_min_non_dep): Likewise.
1238 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1239 to check for equality instead of recursing. Handle tcc_vl_exp
1241 (stabilize_call): Update to only handle CALL_EXPRs, not
1242 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1243 (stabilize_aggr_init): New function.
1244 (stabilize_init): Use it.
1246 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1247 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1248 AGGR_INIT_EXPR accessor macros and argument iterators.
1250 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1251 build_vl_exp. Iterate through the operands, recursively
1252 processing each one.
1253 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1254 CALL_EXPR accessor macros.
1255 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1256 tree code classes. Use TREE_OPERAND_LENGTH instead of
1259 * semantics.c (finish_call_expr): Use build_nt_call_list
1260 instead of build_nt.
1261 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1262 accessor macros. Use build_call_array to construct the
1263 CALL_EXPR node instead of build3
1265 * decl2.c (build_offset_ref_call_from_tree): Use
1266 build_nt_call_list and build_min_non_dep_call_list instead
1267 of build_min_nt and build_min_non_dep.
1269 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1270 Use build_nt_call_list instead of build_min_nt.
1272 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1275 * call.c (build_conditional_expr): Improve error message.
1277 2007-02-13 Dirk Mueller <dmueller@suse.de>
1279 * friend.c (do_friend): Annotate warning about friend
1280 declarations in templates with OPT_Wnon_template_friend.
1281 Convert informal message from warning() to inform().
1283 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1284 Mark Mitchell <mark@codesourcery.com>
1287 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1288 instantiations for variables.
1290 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1293 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1294 Check warn_unused_value just once.
1296 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1299 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1300 (fn_type_unificiation): Likewise.
1301 (get_bindings): Likewise.
1303 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1306 * decl.c (finish_function): Use DECL_REPLACEABLE.
1307 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1309 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1311 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1313 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1315 * decl.c (grokvardecl): Don't error if !have_tls.
1316 (grokdeclarator): Likewise.
1317 * parser.c (cp_parser_omp_threadprivate): Likewise.
1319 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1322 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1323 parameters and result decls in omp clauses.
1324 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1327 2007-02-05 Dirk Mueller <dmueller@suse.de>
1330 * parser.c (cp_parser_class_specifier): Always initialize bases.
1332 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1334 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1335 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1336 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1338 * semantics.c (finish_omp_atomic): Store a whole expression node
1339 in operand 1, and integer_zero_node in operand 0, for dependent
1340 OMP_ATOMIC. Rewrite to make flow easier to understand.
1342 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1344 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1346 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1348 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1349 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1351 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1353 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1354 keyword warning to -Wc++0x-compat.
1356 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1358 * decl.c (grokdeclarator): Update documentation.
1360 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1363 * decl.c (grokdeclarator): If __thread is used together with
1364 a storage class other than extern and static, clear thread_p
1365 after issuing diagnostics and fall through to checking the
1368 2007-01-30 Roger Sayle <roger@eyesopen.com>
1370 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1371 calculating the size of an array (to avoid recursive errors).
1373 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1376 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1378 * call.c (convert_like_real): Don't warn when converting to
1381 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1383 * decl.c (pop_label): Replace warning with call to
1384 warn_for_unused_label.
1386 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1389 * semantics.c (finish_pseudo_destructor_expr): Check the
1390 destrutor name by calling check_dtor_name.
1392 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1394 * lex.c (D_CPP0X): Rename.
1396 (reswords): D_CPP0X -> D_CXX0X.
1397 (init_reswords): Ditto.
1398 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1399 of C++0x keywords as identifiers.
1401 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1404 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1407 2007-01-23 Ian Lance Taylor <iant@google.com>
1409 * typeck.c (convert_for_assignment): Only warn about a = b = c
1410 when converting to bool.
1412 2007-01-23 Roger Sayle <roger@eyesopen.com>
1414 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1416 * typeck.c (ignore_overflows): Remove the remaining uses of
1417 TREE_CONSTANT_OVERFLOW.
1419 2007-01-20 Jan Hubicka <jh@suse.cz>
1421 * decl2.c (start_objects, start_static_storage_duration_function):
1422 Do not make the functions uninlinable.
1424 2007-01-17 Ian Lance Taylor <iant@google.com>
1426 * class.c (add_method): Call VEC_reserve_exact rather than passing
1427 a negative size to VEC_reserve.
1429 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1432 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1434 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1437 * decl.c (make_typename_type): If the qualified name is not a
1438 type, issue an error.
1439 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1442 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1444 * rtti.c: Include target.h.
1445 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1446 don't emit typeinfo for fundamental types as weak.
1447 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1449 2007-01-08 Richard Guenther <rguenther@suse.de>
1451 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1453 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1455 * call.c (standard_conversion): Pass flag to
1456 vector_types_convertible_p to disallow emission of note.
1457 * typeck.c (convert_for_assignment): Pass flag to
1458 vector_types_convertible_p to allow emission of note.
1459 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1460 to disallow emission of note.
1462 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1465 * typeck.c (build_binary_op): Call overflow_warning if
1466 TREE_OVERFLOW_P is true for the result and not for any of the
1469 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1472 * class.c (add_method): Don't wait until template
1473 instantiation time to complain about duplicate methods.
1475 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1478 * semantics.c (finish_unary_op_expr): Warn only if result
1479 overflowed and operands did not.
1481 2007-01-05 Ian Lance Taylor <iant@google.com>
1483 * typeck.c (build_binary_op): Warn about comparing a non-weak
1486 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1488 * pt.c (tsubst): Propagate the need for structural equality checks
1489 when reducing the level of template parameters.
1491 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1493 * pt.c: Fix a comment typo.
1495 2007-01-02 Ian Lance Taylor <iant@google.com>
1497 * semantics.c (maybe_convert_cond): Optionally warn when using an
1498 assignment as a condition.
1499 * typeck.c (convert_for_assignment): Optionally warn about
1500 assigning the result of an assignment to a bool.
1502 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1504 * pt.c (canonical_template_parms): Correct typo in comment.
1506 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1508 * typeck.c (structural_comptypes): Renamed from "comptypes".
1509 (comptypes): Use canonical type information to perform fast type
1510 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1511 canonical type comparison returns the same results as we would see
1512 from the current, structural check. Support COMPARE_STRUCTURAL
1513 when we need structural checks.
1514 * decl.c (typename_compare): Fix comment.
1515 (build_typename_type): TYPENAME_TYPE nodes require structural
1516 equality checks, because they resolve different based on the
1518 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1519 require structural equality checks (for now).
1520 (build_ptrmemfunc_type): Build the canonical pointer to member
1522 (compute_array_index_type): Whenever we build a new index type
1523 to represent the size of an array in a template, we need to mark
1524 this index type as requiring structural equality. This goes for
1525 arrays with value-dependent sizes with the current ABI, or all
1527 * tree.c (cplus_array_hash): New.
1528 (struct cplus_array_info): New.
1529 (cplus_array_compare): New.
1530 (cplus_array_htab): New.
1531 (build_cplus_array_type_1): Use a hash table to cache the array
1532 types we build. Build the canonical array type for each array
1534 (cp_build_qualified_type_real): When building a cv-qualified array
1535 type, use the hash table of array types and build canonical array
1537 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1538 use structural equality (for now).
1539 * cp-tree.h (COMPARE_STRUCTURAL): New.
1540 * pt.c (canonical_template_parms): New.
1541 (canonical_type_parameter): New.
1542 (process_template_parm): Find the canonical type parameter.
1543 (lookup_template_class): When we have named the primary template
1544 type, set the canonical type for our template class to the primary
1545 template type. If any of the template arguments need structural
1546 equality checks, the template class needs structural equality
1548 (tsubst): When reducing the level of a template template
1549 parameter, we require structural equality tests for the resulting
1550 parameter because its template parameters have not had their types
1551 canonicalized. When reducing a template type parameter, find the
1552 canonical reduced type parameter.
1553 (any_template_arguments_need_structural_equality_p): New.