1 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3 * decl.c (typename_hash, typename_compare): Constify.
4 * mangle.c (hash_type, compare_type): Likewise.
5 * pt.c (eq_local_specializations, hash_local_specialization):
7 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
9 * typeck2.c (pat_compare): Likewise.
11 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
13 * method.c (implicitly_declare_fn): Increase alignment if member
14 function pointer format requires it.
16 2007-07-24 Paolo Carlini <pcarlini@suse.de>
19 * typeck.c (check_return_expr): Do not pass a null argument
22 2007-07-24 Paolo Carlini <pcarlini@suse.de>
25 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
28 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
31 * typeck.c (convert_arguments): Only use default args if we have
35 * typeck.c (structural_comptypes): No need to check
36 resolve_typename_type return value here.
37 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
38 * pt.c (resolve_typename_type): Follow typename typedefs. Return
39 original type rather than error_mark_node in case of failure.
40 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
41 resolve_typename_type result check.
42 (cp_parser_direct_declarator, cp_parser_head,
43 cp_parser_constructor_declarator_p): Likewise.
45 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
47 * pt.c (template_parms_variadic_p): Remove.
48 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
50 2007-07-12 Jakub Jelinek <jakub@redhat.com>
53 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
54 argument to dump_aggr_init_expr_args instead of false.
56 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
58 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
59 canonical types; otherwise, fall back to structural type
60 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
61 internal compiler error if the canonical types are wrong.
63 2007-07-11 Paolo Carlini <pcarlini@suse.de>
66 * parser.c (cp_parser_make_indirect_declarator): When the
67 the code argument is ERROR_MARK return cp_error_declarator.
69 2007-07-09 Geoffrey Keating <geoffk@apple.com>
72 * decl.c (cxx_init_decl_processing): Don't set
73 force_align_functions_log.
74 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
75 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
76 FUNCTION_DECL, return its alignment.
78 2007-07-09 Richard Guenther <rguenther@suse.de>
80 * decl.c (start_preparsed_function): Do not promote return type.
82 2007-07-08 Paolo Carlini <pcarlini@suse.de>
85 * pt.c (unify): Never pass error_mark_node to template_decl_level.
87 2007-07-07 Mark Mitchell <mark@codesourcery.com>
90 * pt.c (resolve_overloaded_unification): Robustify. Return a
92 (type_unification_real): Adjust accordingly.
94 2007-07-06 Richard Guenther <rguenther@suse.de>
96 * init.c (build_new_1): Use the correct pointer type.
97 * typeck2.c (build_m_component_ref): Likewise.
99 2007-07-05 Mark Mitchell <mark@codesourcery.com>
102 * init.c (build_zero_init): Always build an initializer for
104 * typeck2.c (build_functional_cast): Use build_zero_init.
107 * init.c (build_new_1): Always pass the allocation function to
108 build_op_delete_call.
109 * call.c (build_op_delete_call): Handle operator delete with a
110 variable-argument list. Do not issue an error when no matching
111 deallocation function is available for a new operator.
114 * cp-tree.h (any_value_dependent_elements_p): Declare it.
115 * decl.c (value_dependent_init_p): New function.
116 (cp_finish_decl): Use it.
117 * pt.c (value_dependent_expression_p): Use
118 any_value_dependent_elements_p.
119 * parser.c (cp_parser_primary_expression): Add comment about
120 treating dependent qualified names as integral
121 constant-expressions.
123 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
125 * decl.c (build_ptrmemfunc_type): Always use structural equality
126 tests when comparing pointer-to-member-function types, because the
127 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
130 2007-07-03 Mark Mitchell <mark@codesourcery.com>
132 * init.c (build_new): Tweak comment.
134 2007-06-29 Dave Brolley <brolley@redhat.com>
137 * parser.c (cp_parser_new_type_id): Don't reduce a named array
138 type to its base type and number of elements here.
139 * init.c (build_new): Call complete_type_or_else to ensure that the
140 type is complete and to issue a diagnostic if it is not.
141 (build_new_1): Don't call complete_type_or_else here.
143 2007-07-03 Richard Guenther <rguenther@suse.de>
146 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
149 2007-07-02 Simon Baldwin <simonb@google.com>
151 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
152 for inner-style nested forward declarations that don't declare
155 2007-07-02 Jakub Jelinek <jakub@redhat.com>
158 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
159 DECL_P in not a variable and appears more than once error messages.
161 2007-07-01 Ollie Wild <aaw@google.com>
163 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
164 (select_decl): Remove function.
165 (unqualified_namespace_lookup): Populate binding by calling
166 ambiguous_decl. Remove select_decl call.
167 (lookup_qualified_name): Remove select_decl call.
168 * decl.c (lookup_and_check_tag): Check for ambiguous references.
169 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
170 generation when name lookup is ambiguous.
172 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
175 * init.c (build_new_1): Use structural equality on the copy of the
178 2007-06-28 Geoffrey Keating <geoffk@apple.com>
180 * decl2.c (determine_visibility): Implement
181 flag_visibility_ms_compat effect on type info.
182 * decl.c (cxx_init_decl_processing): Implement
183 global effect of flag_visibility_ms_compat.
185 2007-06-28 Geoffrey Keating <geoffk@apple.com>
187 * decl2.c (start_objects): Mark constructor-running function
190 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
193 * decl.c (grokdeclarator): Reset friendp for member functions declared
194 friend of their own class.
196 2007-06-23 Mark Mitchell <mark@codesourcery.com>
198 * decl2.c (determine_visibility): Don't look for dllexport here.
199 (determine_visibility_from_class): Tidy.
201 2007-06-18 Simon Baldwin <simonb@google.com>
204 * parser.c (cp_parser_single_declaration): Added check for storage
205 class other than sc_none in parsed declaration, and a flag to indicate
206 if the call is part of an explicit template specialization parse.
207 * (cp_parser_explicit_specialization): Specialization check flag added
208 to call to cp_parser_single_declaration(), set true.
209 * (cp_parser_template_declaration_after_export): Specialization check
210 flag added to call to cp_parser_single_declaration(), set false.
211 * pt.c (check_explicit_specialization): Added code to copy visiblity
212 and linkage from the templated function to the explicit specialization.
214 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
216 * typeck.c (build_binary_op): For templates build the
217 expression in pieces to avoid the assert in build2_stat.
218 (get_member_function_from_ptrfunc):
219 Change over to using POINTER_PLUS_EXPR and convert
220 the second operand to sizetype.
221 * typeck2.c (build_m_component_ref): Likewise.
222 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
223 instead of PLUS_EXPR for pointers.
224 (build_new_1): Likewise.
225 (build_vec_delete_1): Likewise.
226 (build_vec_delete): Likewise.
227 * class.c (build_base_path): Likewise.
228 (build_base_path): Likewise.
229 (convert_to_base_statically): Likewise.
230 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
231 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
232 instead of PLUS_EXPR.
233 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
234 instead of PLUS_EXPR for pointers.
235 * call.c (build_special_member_call): Likewise.
236 * rtti.c (build_headof): Likewise.
237 Use sizetype instead of ptrdiff_type_node.
238 (tinfo_base_init): Create a POINTER_PLUS_EXPR
239 instead of PLUS_EXPR for pointers.
240 * except.c (expand_start_catch_block): Do a
241 NEGATIVE and then a POINTER_PLUS_EXPR instead
243 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
244 PLUS_EXPR on pointer types over to use
245 POINTER_PLUS_EXPR and remove the conversion
246 to the pointer types.
247 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
248 adding to a pointer type. Use size_int instead of
249 ssize_int. Convert the index to sizetype before
250 adding it to the pointer.
252 2007-06-15 Mark Mitchell <mark@codesourcery.com>
254 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
255 (DECL_ANON_UNION_VAR_P): New macro.
256 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
257 than DECL_VAR_MARKED_P, to keep track of which variables we have
259 * decl.c (redeclaration_error_message): Complain about redeclaring
260 anonymous union members at namespace scope.
261 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
263 2007-06-14 Geoff Keating <geoffk@apple.com>
265 * decl2.c (determine_visibility): Ensure that functions with
266 hidden types as parameters are hidden.
269 * decl2.c (determine_visibility): Remove duplicate code for
272 2007-06-12 Ian Lance Taylor <iant@google.com>
275 * init.c (avoid_placement_new_aliasing): New static function.
276 (build_new_1): Call it.
278 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
280 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
281 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
283 2007-06-08 Jakub Jelinek <jakub@redhat.com>
286 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
287 on init, the non-decl cond operand and increment value.
289 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
292 * decl.c (check_initializer): Report an error when a brace enclosed
293 initializer is used for a non-aggregate type in C++98.
294 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
296 (grokdeclarator): Likewise.
297 (move_fn_p): Likewise.
298 * typeck.c (check_return_expr): Likewise.
299 * call.c (reference_binding): Likewise.
300 * error.c (cp_cpp_error): Likewise.
301 * pt.c (check_default_tmpl_args): Likewise.
303 * lex.c (init_reswords): Likewise.
304 * parser.c (p_parser_primary_expression): Likewise.
305 (TOKEN_PRECEDENCE): Likewise.
306 (cp_parser_init_declarator): Likewise.
307 (cp_parser_ptr_operator): Likewise.
308 (cp_parser_parameter_declaration): Likewise.
309 (cp_parser_enclosed_template_argument_list): Likewise.
310 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
311 (cp_parser_next_token_ends_template_argument_p): Likewise.
313 2007-06-04 Simon Baldwin <simonb@google.com>
315 * decl.c (grokdeclarator): Readability change. Moved case labels
316 into direct switch statement scope.
318 2007-06-04 Paolo Carlini <pcarlini@suse.de>
320 * call.c (convert_like_real): Remove pointless code.
322 2007-05-31 Mark Mitchell <mark@codesourcery.com>
324 * decl.c (get_atexit_fn_ptr_type): New function.
325 (get_atexit_node): Use it.
326 (start_cleanup_fn): Likewise.
327 (register_dtor_fn): Use the object's destructor, instead of a
328 separate cleanup function, where possible.
329 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
330 (atexit_fn_ptr_type_node): New macro.
331 * decl2.c (build_cleanup): Use build_address.
333 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
335 * typeck.c (build_binary_op): Include types in error.
337 2007-05-31 Jakub Jelinek <jakub@redhat.com>
340 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
341 needs runtime initialization.
343 2007-05-31 Paolo Carlini <pcarlini@suse.de>
346 * semantics.c (finish_trait_expr): Complete the types.
348 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
349 Douglas Gregor <doug.gregor@gmail.com>
350 Pedro Lamarao <pedro.lamarao@mndfck.org>
351 Howard Hinnant <howard.hinnant@gmail.com>
355 * typeck.c (comptypes): Don't consider rvalue and lvalue
356 reference types to be equivalent.
357 (check_return_expr): Move from certain lvalues when returning
359 * decl.c (grokdeclarator): Implement reference collapsing.
360 (copy_fn_p): Don't consider constructors taking rvalue references
361 to be copy constructors.
363 * call.c (conversion): New "rvaluedness_matches_p" member.
364 (convert_class_to_reference): Require reference type as first
365 parameter instead of base type.
366 (reference_binding): Add logic to handle rvalue references.
367 (implicit_conversion): Update inaccurate comment.
368 (convert_like_real): Disable creation of temporaries that are
369 impossible to initialize for types with move constructors.
370 (build_over_call): Elide move constructors when possible.
371 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
372 (maybe_handle_ref_bind): Return conversion instead of type node.
373 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
374 determine preferred conversion sequences.
375 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
376 (LOOKUP_PREFER_RVALUE): New.
377 (DECL_MOVE_CONSTRUCTOR_P): New.
378 (struct cp_declarator): Add "reference" member for reference
379 types, with new "rvalue_ref" flag.
380 (cp_build_reference_type): Declare.
381 (move_fn_p): Declare.
382 * error.c (dump_type_prefix): Format rvalue reference types
383 correctly in error messages.
384 * except.c (build_throw): Move from certain lvalues when
386 * mangle.c (write_type): Mangle rvalue references differently
387 than regular references.
388 * parser.c (make_reference_declarator): Add boolean parameter for
390 (cp_parser_make_indirect_declarator): New.
391 (cp_parser_new_declarator_opt): Call
392 cp_parser_make_indirect_declarator.
393 (cp_parser_conversion_declarator_opt): Ditto.
394 (cp_parser_declarator): Ditto.
395 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
397 * pt.c (tsubst): Implement reference collapsing.
398 (maybe_adjust_types_for_deduction): Implement special template
399 parameter deduction rule for rvalue references.
400 (type_unification_real): Update calls to
401 maybe_adjust_types_for_deduction.
402 (try_one_overload): Ditto.
403 (unify_pack_expansion): Ditto.
404 * tree.c (lvalue_p_1): Handle rvalue reference types.
405 (cp_build_reference_type): New.
407 2007-05-30 Jakub Jelinek <jakub@redhat.com>
410 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
411 variables that need runtime initialization.
413 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
416 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
417 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
418 case POSTDECREMENT_EXPR>): Return the error_mark_node
419 if either the real or imaginary parts would an
422 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
423 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
426 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
427 token is a closing brace, false if there are no tokens left.
428 (cp_parser_namespace_alias_definition): Only consume the next token if
429 it is a closing brace.
431 * parser.c (cp_parser_class_specifier): Likewise.
433 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
435 * semantics.c (finish_member_declaration): Fix a typo in the
438 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
450 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
451 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
452 * pt.c (check_for_bare_parameter_packs): Return bool indicated
453 whether everything was okay. Fix indentation.
454 (push_template_decl_real): Check for bare parameter packs in
455 function parameters; where errors occur, mark the parameter types
456 with ERROR_MARK_NODEs to avert ICEs.
457 (coerce_template_parameter_pack): New.
458 (coerce_template_parms): Moved parameter pack coercion into
459 coerce_template_parameter_pack, and permit it anywhere in the
460 template parameter list (not just at the end). Parameter and
461 argument indices can vary (somewhat) separately now, so add
462 PARM_IDX and ARG_IDX.
463 (fn_type_unification): Don't set an argument pack as incomplete if
464 no argument pack was deduced.
465 (type_unification_real): If a type parameter is a parameter pack
466 and has not otherwise been deduced, it will be deduced to an empty
468 (more_specialized_fn): Use the actual lengths of the argument
469 lists when comparing against expansions.
470 * semantics.c (finish_member_declaration): If a field's type has
471 bare parameter packs, error and set its type to ERROR_MARK_NODE.
473 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
476 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
478 2007-05-22 Ollie Wild <aaw@google.com>
480 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
481 (unqualified_namespace_lookup): Adds check for hidden types.
483 2007-05-22 Ollie Wild <aaw@google.com>
485 * decl.c (duplicate_decls): Verify namespace names are unique.
487 2007-05-21 Mark Mitchell <mark@codesourcery.com>
489 * decl.c (cxx_maybe_build_cleanup): Handle
490 __attribute__((cleanup)).
492 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
494 * cvt.c (cp_convert_and_check): Don't check warnings if the
497 2007-05-18 Geoffrey Keating <geoffk@apple.com>
499 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
501 2007-05-14 Paolo Carlini <pcarlini@suse.de>
504 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
505 type only if is a class type (5.2.8/4).
507 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
509 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
510 * decl.c (grokdeclarator): Use unsigned_type_for instead of
511 c_common_unsigned_type.
513 2007-05-11 Silvius Rus <rus@google.com>
515 * cp/typeck.c (build_indirect_ref): Add call to
516 strict_aliasing_warning.
517 (build_reinterpret_cast_1): Condition call to
518 strict_aliasing_warning.
520 2007-05-11 Jan Hubicka <jh@suse.cz>
522 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
523 * decl2.c (start_objects): ctors and dtors are no longer public.
524 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
526 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
528 * typeck.c (build_unary_op): Remove code that used to
529 handle non lvalue increments/decrements.
531 2007-05-07 Mike Stump <mrs@apple.com>
533 * parser.c (check_empty_body): Add.
534 (cp_parser_iteration_statement): Add call to check_empty_body.
536 2007-05-05 Geoffrey Keating <geoffk@apple.com>
539 * mangle.c (write_mangled_name): Mangle static variable names.
540 (write_unqualified_name): Use local-source-name for
541 namespace-scope static variables.
543 2007-05-04 Dirk Mueller <dmueller@suse.de>
545 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
548 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
551 * decl2.c (constrain_class_visibility):
552 Use strip_pointer_or_array_types instead of strip_array_types.
554 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
557 * decl.c (reshape_init_r): Don't reshape the first element if it
558 is a pointer to member function.
560 2007-04-27 Simon Baldwin <simonb@google.com>
562 * decl.c (grokparms): Changed message format from %qD to %qE.
564 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
566 * error.c (maybe_warn_variadic_templates): Variadic templates are
567 now in C++0x, so only warn about them in C++98 mode.
569 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
572 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
573 integeral types from vectors types.
575 2007-04-26 Jakub Jelinek <jakub@redhat.com>
578 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
579 for type dependent OMP_CLAUSE_DECLs.
581 2007-04-24 Mark Mitchell <mark@codesourcery.com>
584 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
585 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
586 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
587 * init.c (build_zero_init): Adjust, as
588 COMPLEX_TYPE is now a SCALAR_TYPE.
589 * typeck2.c (digest_init): Allow brace-enclosed initializers for
590 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
592 2007-04-25 Paolo Carlini <pcarlini@suse.de>
594 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
595 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
596 (trait_expr_value): Adjust.
598 2007-04-23 Simon Baldwin <simonb@google.com>
600 * decl.c (grokparms): Added new error for duplicate function
601 parameters names in function prototypes, to match gcc behavior.
603 2007-04-23 Jan Hubicka <jh@suse.cz>
605 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
608 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
610 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
611 instead of checking GIMPLE_STMT_P in chain_next.
613 2007-04-17 Mark Mitchell <mark@codesourcery.com>
616 * call.c (convert_for_arg_passing): Convert bitfields to their
619 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
622 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
624 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
628 * cp/decl2.c (constrain_class_visibility):
629 Do not warn about the use of anonymous namespace in the main input file.
631 2007-04-15 Mark Mitchell <mark@codesourcery.com>
633 * cp-tree.h (current_template_parms): Fix typo in comment.
635 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
637 * cp-tree.h, error.c: Fix comment typos.
639 2007-04-13 Jason Merrill <jason@redhat.com>
642 * call.c (reference_binding): Add c_cast_p parm. If true,
643 add quals to TO as needed to make it reference-compatible.
645 2007-04-11 Jan Hubicka <jh@suse.cz>
647 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
648 that we are not processing template_decl.
650 2007-04-09 Mark Mitchell <mark@codesourcery.com>
653 * class.c (build_base_path): Ensure that the converted pointer has
654 the same cv-qualification as the input.
656 2007-04-09 Paolo Carlini <pcarlini@suse.de>
658 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
660 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
662 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
664 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
665 * tree.c (cp_add_pending_fn_decls): Remove.
666 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
668 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
670 Revert change removing staticp.
672 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
674 * cp-objcp-common.c (cxx_staticp): Remove.
675 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
676 * cp-tree.h (cxx_staticp):
678 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
680 * class.c (check_for_override): Don't remove dllmport attribute
683 2007-04-03 Jakub Jelinek <jakub@redhat.com>
686 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
687 type issue error and return early.
689 2007-03-30 Jason Merrill <jason@redhat.com>
692 * typeck.c (cp_type_readonly): New fn.
693 * cp-tree.h: Declare it.
694 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
695 (cp_finish_decl): Not here.
697 2007-03-31 Richard Guenther <rguenther@suse.de>
699 * optimize.c (maybe_clone_body): Replace splay-tree usage by
702 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
707 * parser.c (declarator_can_be_parameter_pack): New.
708 (cp_parser_template_parameter): Only parse the `...' if the
709 declarator can be a parameter pack.
710 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
712 * pt.c (find_parameter_packs_r): Look into the bounds on integer
713 types (they could be used as array bounds).
714 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
715 (tsubst_pack_expansion): Handle failure to expand parameter
718 2007-03-30 Paolo Carlini <pcarlini@suse.de>
721 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
722 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
723 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
724 (CLASS_TYPE_NON_UNION_P): Add.
725 (struct lang_type_class): Add has_complex_dflt.
726 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
727 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
728 * cp-tree.def: Add TRAIT_EXPR.
729 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
730 * lex.c (struct resword): Add __has_nothrow_assign,
731 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
732 __has_trivial_constructor, __has_trivial_copy,
733 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
734 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
735 __is_pod, __is_polymorphic, __is_union.
736 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
737 (cp_parser_trait_expr): New.
738 * semantics.c (finish_trait_expr, trait_expr_value
739 classtype_has_nothrow_copy_or_assign_p): New.
740 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
742 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
743 * class.c (check_bases, check_field_decl, check_bases_and_members):
744 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
745 * pt.c (uses_template_parms, tsubst_copy_and_build,
746 value_dependent_expression_p, type_dependent_expression_p): Deal with
748 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
750 2007-03-29 Richard Guenther <rguenther@suse.de>
752 * tree.c (cp_walk_subtrees): Do not set input_location.
754 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
757 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
760 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
762 * parser.c (struct cp_parser): Update comment for
763 greater_than_is_operator_p.
764 (cp_parser_primary_expression): In C++0x mode, a cast operator can
765 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
766 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
767 !GREATER_THAN_IS_OPERATOR_P.
768 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
769 `>>' operators that will become two `>' tokens in C++0x.
770 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
771 mode, allowing it to terminate default arguments.
772 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
773 `>>' like two consecutive `>' tokens.
774 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
775 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
776 ends a template argument.
778 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
780 * decl.c (redeclaration_error_message): Complain when redeclaring
781 a friend function with default template arguments (C++0x mode only).
782 * cp-tree.h (check_default_tmpl_args): Declare.
783 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
784 template arguments in function templates. Add support for checking
785 the default template arguments of friend templates.
786 (push_template_decl_real): Fix call to check_default_tmpl_args.
787 (type_unification_real): If a template parameter has not been
788 deduced but provides a default template argument, substitute into
789 that default template argument.
790 * parser.c (cp_parser_init_declarator): When declaring (but not
791 defining!) a function template in C++0x mode, check for default
794 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
797 * decl.c (grokdeclarator): Deal with cv-qualified function type
798 typedefs in the same way for member and non-member functions.
800 2007-03-26 Dirk Mueller <dmueller@suse.de>
802 * parser.c (cp_parser_member_declaration): Pedwarn
803 about stray semicolons after member declarations.
805 2007-03-26 Paolo Carlini <pcarlini@suse.de>
808 * pt.c (instantiate_decl): Set in_system_header.
810 2007-03-22 Mark Mitchell <mark@codesourcery.com>
812 * cp-tree.h (current_tempalte_parms): Improve documentation.
813 * pt.c (current_template_args): Likewise.
816 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
817 not consume tokens when failing.
819 2007-03-22 Jim Wilson <wilson@specifix.com>
820 Mark Mitchell <mark@codesourcery.com>
823 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
824 consistent with FROM.
826 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
828 * error.c (dump_expr): Handle dependent names that designate types.
829 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
831 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
833 * cp-tree.def, parser.c, pt.c: Fix comment typos.
835 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
837 * cvt.c (cp_convert_and_check) : Define.
838 * cp-tree.h (cp_convert_and_check): Declare.
839 * call.c (convert_conversion_warnings): Rename to
840 conversion_null_warnings. The warning for floating-point to
841 integer is handled by convert_and_check in convert_like_real.
842 (convert_like_real): convert_conversion_warnings was renamed as
843 conversion_null_warnings.
844 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
845 overflow and changes of value during conversion.
847 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
850 * parser.c (cp_parser_statement): If 'namespace' is found, this
851 only can be a namespace alias definition, so parse it now.
852 (cp_parser_namespace_alias_definition): if we find an open brace
853 instead of '=', then this is actually a misplaced namespace
856 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
859 * decl.c (cxx_init_decl_processing): Move command-line options
860 processing to c-opts.c.
862 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
864 * ptree.c (cxx_print_type): Use formatting markup for integers
865 when printing template parameter index/level/orig level.
866 (cxx_print_xnode): Ditto.
867 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
868 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
869 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
871 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
872 rather than a HOST_WIDE_INT.
873 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
874 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
876 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
877 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
878 IN_BASE_INITIALIZER bool bitfields.
879 (struct cp_declarator): Make KIND a 4-bit field. Make
880 PARAMETER_PACK_P a bool bitfield just after KIND.
881 * pt.c (uses_parameter_packs): Destroy the pointer set.
882 (make_pack_expansion): Ditto.
883 (check_for_bare_parameter_packs): Ditto.
884 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
886 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
889 * call.c (convert_default_arg): Instead of copying the node,
892 2007-03-15 Dirk Mueller <dmueller@suse.de>
895 * call.c (convert_conversion_warnings): New..
896 (convert_like_real): .. factored out from here.
897 (convert_conversion_warnings): Add warning about
898 false being converted to NULL in argument passing.
900 2007-03-14 Dirk Mueller <dmueller@suse.de>
902 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
903 (finish_do_body): Warn about empty body in do/while statement.
905 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
907 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
909 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
912 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
915 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
917 * cp/repo.c (init_repo): Initialize random_seed saved options.
918 (finish_repo): Adjust.
920 2007-03-13 Mark Mitchell <mark@codesourcery.com>
923 * Make-lang.in (doc/g++.1): Use $< to specify the location from
926 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
928 * decl.c (compute_array_index_type): New warning flag warn_vla.
930 2007-03-12 Mark Mitchell <mark@codesourcery.com>
933 * call.c (convert_default_arg): Copy non-constant arguments.
935 2007-03-11 Mark Mitchell <mark@codesourcery.com>
938 * parser.c (cp_parser_postfix_expression): Disallow compound
939 literals in constant expressions.
942 * semantics.c (finish_typeof): Use unlowered_expr_type.
944 2007-03-10 Mark Mitchell <mark@codesourcery.com>
947 * cp-tree.h (unlowered_expr_type): New function.
948 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
949 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
950 (unlowered_expr_type): New function.
951 (build_unary_op): Disallow predecrements of bool bitfields.
952 * call.c (build_conditional_expr): Use unlowered_expr_type.
953 * pt.c (type_unification_real): Likewise.
955 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
958 * typeck.c (check_return_expr): Check for bare parameter packs.
959 (comptypes): Compare template parameter packs and
960 type pack expansions.
961 * decl.c (grokdeclarator): Deal with the declaration of function
963 (grokparms): Verify that the (optional) function parameter pack is
964 at the end of the parameter list.
965 (xref_basetypes): Handle pack expansions in the base class.
966 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
967 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
968 (NONTYPE_ARGUMENT_PACK): New.
969 (TYPE_PACK_EXPANSION): New.
970 (EXPR_PACK_EXPANSION): New.
971 (ARGUMENT_PACK_SELECT): New.
972 * cp-objcp-common.c (cp_tree_size): Compute size of
973 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
974 ARGUMENT_PACK_SELECT.
975 * error.c (dump_template_argument): Print template argument packs.
976 (dump_template_argument_list): Ditto.
977 (dump_template_parameter): Dump `...' for template type parameter
979 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
980 (dump_parameters): Print function parameter packs.
981 (dump_template_parms): Print template argument packs.
982 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
983 (maybe_warn_variadic_templates): New.
984 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
985 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
986 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
988 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
989 (write_template_arg): Write argument packs as separate arguments.
990 * cp-tree.h (struct template_parm_index_s): Add flag that
991 indicates that the template parameter is actually a parameter
993 (struct tree_argument_pack_select): New.
994 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
995 (union lang_tree_node): Add argument_pack_select.
996 (FUNCTION_PARAMETER_PACK_P): New.
997 (PACK_EXPANSION_P): New.
998 (PACK_EXPANSION_PATTERN): New.
999 (SET_PACK_EXPANSION_PATTERN): New.
1000 (PACK_EXPANSION_PARAMETER_PACKS): New.
1001 (ARGUMENT_PACK_P): New.
1002 (ARGUMENT_PACK_ARGS): New.
1003 (SET_ARGUMENT_PACK_ARGS): New.
1004 (ARGUMENT_PACK_INCOMPLETE_P): New.
1005 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1006 (TEMPLATE_PARM_PARAMETER_PACK): New.
1007 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1008 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1009 (ARGUMENT_PACK_SELECT_INDEX): New.
1010 (ARGUMENT_PACK_SELECT_ARG): New.
1011 (struct cp_declarator): Add parameter_pack_p flag.
1012 (maybe_warn_variadic_templates): Declare.
1013 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1014 indicate a template parameter pack.
1015 (uses_parameter_packs): Declare.
1016 (template_parameter_pack_p): Declare.
1017 (template_parms_variadic_p): Declare.
1018 (make_pack_expansion): Declare.
1019 (check_for_bare_parameter_packs): Declare.
1020 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1021 sizeof... expressions.
1022 (pp_cxx_expression): Print pack expansions and non-type argument
1024 (pp_cxx_exception_specification): Print pack expansions.
1025 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1026 (pp_cxx_ctor_initializer): Print pack expansions.
1027 (pp_cxx_type_id): Print pack expansions.
1028 (pp_cxx_template_argument_list): Print argument packs.
1029 (pp_cxx_template_parameter): Print ellipsis for template parameter
1031 * pt.c (comp_template_parms): Compare template parameter packs.
1032 (template_parameter_pack_p): New.
1033 (template_parms_variadic_p): New.
1034 (template_args_variadic_p): New.
1035 (make_ith_pack_parameter_name): New.
1036 (struct find_parameter_pack_data): New.
1037 (find_parameter_packs_r): New.
1038 (uses_parameter_packs): New.
1039 (make_pack_expansion): New.
1040 (check_for_bare_parameter_packs): New.
1041 (expand_template_argument_pack): New.
1042 (reduce_template_parm_level): Propagate parameter pack flag.
1043 (process_template_parm): Add is_parameter_pack parameter to state
1044 when the parameter is actually a parameter pack. Create template
1045 parameter packs when is_parameter_pack is true.
1046 (current_template_args): The argument for a template parameter
1047 pack is an argument pack containing a single pack expansion.
1048 (process_partial_specialization): When checking that non-type
1049 argument expressions do not involve template parameters, loop over
1050 the arguments in argument packs separately.
1051 (push_template_decl_real): Check that the type of the declaration
1052 does not have any bare parameter packs. Check that primary
1053 templates have no more than one parameter pack, and that it comes
1054 at the end of the template parameter list.
1055 (convert_template_argument): Handle coercions for pack expansion
1056 expressions by coercing the pattern then rebuilding the expansion.
1057 (coerce_template_parms): When coercing the arguments for a
1058 variadic template, pack "extra" arguments into an argument pack.
1059 (coerce_template_template_parms): Cannot coerce between parameter
1060 packs and non-pack parameters.
1061 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1062 (comp_template_args): Expand all template arguments packs before
1063 comparing template argument lists.
1064 (mangle_class_name_for_template): Make argument packs as separate
1066 (for_each_template_parm_r): No need to handle BASELINK.
1067 (instantiate_class_template): Handle pack expansions in the base
1069 (tsubst_pack_expansion): New.
1070 (tsubst_template_args): Handle substitutions of argument packs and
1071 pack expansion into template argument lists.
1072 (tsubst_decl): Expand function parameter packs into separate
1073 function parameters.
1074 (tsubst_arg_types): Expand a type pack expansion into separate
1076 (tsubst_exception_specification): Handle pack expansions in
1077 exception specifiers.
1078 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1079 replacing a template parameter with its argument. If we encounter
1080 a substitution for an argument pack, just return the parameter
1082 (tsubst_copy): sizeof(X...) returns the number of elements in
1083 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1084 PARM_DECL is a parameter pack.
1085 (tsubst_expr): Expression pack expansions and argument packs
1086 cannot show up here; they will all be handled through function
1087 calls, sizeof, and template argument lists.
1088 (tsubst_copy_and_build): sizeof(X...) returns the number of
1089 elements in parameter pack X. Handle pack expansions in TREE_LIST
1090 and CONSTRUCTOR nodes.
1091 (fn_type_unification): Handle "incomplete" explicit template
1092 argument lists that specify some of the arguments for a template
1094 (type_unification_real): Unify arguments against pack expansions.
1095 (template_parm_level_and_index): New, helper function.
1096 (unify_pack_expansion): New.
1097 (unify): Unify argument packs on an argument-by-argument basis,
1098 handling variadic argument packs as well.
1099 (more_specialized_fn): Handle unification of function parameter
1100 packs. All things being equal, prefer non-variadic function
1101 templates to variadic function templates.
1102 (more_specialized_class): Prefer the variadic class template
1103 partial specialization that binds fewer arguments to a parameter
1105 (regenerate_decl_from_template): Expand function parameter packs
1106 into separate parameters.
1107 (instantiate_decl): Ditto.
1108 (tsubst_initializer_list): Handle pack expansions for base-class
1110 (dependent_type_p_r): Determine dependent types in argument packs
1111 and pack expansions.
1112 (value_dependent_expression_p): Determine value-dependence of
1113 non-type argument packs.
1114 (dependent_template_arg_p): Handle argument packs.
1115 * semantics.c (finish_cond): Check for bare parameter packs.
1116 (finish_expr_stmt): Ditto.
1117 (finish_for_expr): Ditto.
1118 (finish_switch_cond): Ditto.
1119 (finish_mem_initializers): Ditto.
1120 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1122 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1123 * parser.c (make_declarator): Declarator is not an expansion.
1124 (make_pointer_declarator): Transfer parameter pack flag to outer
1126 (make_reference_declarator): Ditto.
1127 (make_ptrmem_declarator): Ditto.
1128 (make_call_declarator): Ditto.
1129 (make_array_declarator): Ditto.
1130 (cp_parser_postfix_expression): Allow pack expansion expressions
1131 in the argument list for a call expression.
1132 (cp_parser_parenthesized_expression_list): Add new parameter
1133 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1134 into separate arguments."
1135 (cp_parser_new_placement): Allow pack expansion expressions.
1136 (cp_parser_new_initializer): Ditto.
1137 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1138 base-class initializer expansion.
1139 (cp_parser_mem_initializer): Ditto.
1140 (cp_parser_template_parameter_list): Keep track of whether the
1141 template parameter is a template parameter pack.
1142 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1143 template parameter pack.
1144 (cp_parser_type_parameter): Ditto.
1145 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1147 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1148 this declarator is a parameter pack.
1149 (cp_parser_parameter_declaration): The ellipsis does not end the
1150 parameter declaration, because it might be a parameter pack. Parse
1151 the ellipsis to indicate a parameter pack.
1152 (cp_parser_initializer): Allow pack expansions.
1153 (cp_parser_initializer_list): Allow ellipsis to create an
1154 initializer expansion.
1155 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1157 (cp_parser_type_id_list): Allow ellipsis to create an exception
1158 specifier expansion.
1159 (cp_parser_attribute_list): Don't allow pack expansions.
1160 (cp_parser_functional_cast): Allow pack expansions.
1161 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1162 compute the length of a parameter pack.
1163 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1164 end a template argument.
1165 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1166 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1169 2007-03-09 Dirk Mueller <dmueller@suse.de>
1171 * cp/call.c (build_new_op): Call warn_logical_operator.
1173 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1176 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1179 * pt.c (any_template_arguments_need_structural_equality_p):
1182 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1184 * decl.c (grokdeclarator): Disable warnings for anonymous
1187 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1189 * typeck2.c (readonly_error): Always emit a hard error.
1190 Remove last argument.
1191 * cp-tree.h (readonly_error): Adjust prototype.
1192 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1193 * typeck.c (build_unary_op): Likewise.
1194 (build_modify_expr): Likewise.
1196 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1199 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1201 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1204 * parser.c (struct cp_parser): New IN_IF_STMT.
1205 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1206 returning if parsing the body of an 'if' statement or issuing an
1207 error and continuing.
1208 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1210 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1212 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1215 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1218 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1220 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1221 Objective-C++. Don't exit early if -shared-libgcc needs to be
1224 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1226 * typeck.c (common_base_type): Delete unused function.
1228 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1230 * Make-lang.in: Add dummy lang.install-pdf target.
1232 2007-03-01 Simon Baldwin <simonb@google.com>
1235 * decl.c (check_tag_decl): Added new warning for typedef ignored
1236 when it precedes an otherwise valid non-typedef declaration.
1238 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1240 * typeck.c (build_function_call): Store converted arguments
1241 in a stack-allocated array instead of building a list.
1242 (convert_arguments): Store arguments in the array passed in as an
1243 argument, and return the actual number of arguments.
1244 * call.c (build_call): Delete, and replace with...
1245 (build_call_n, build_call_a): New.
1246 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1247 (build_over_call): Store converted arguments in a stack-allocated
1248 array instead of building a list.
1249 (build_cxx_call): Pass arguments in an array instead of as a list.
1250 (build_java_interface_fn_ref): Rewrite to avoid constructing
1252 * tree.h: Update declarations to reflect above changes.
1253 * method.c (use_thunk): Use a stack-allocated array to hold
1254 the arguments instead of a list.
1255 * rtti.c (throw_bad_cast): Update call to cxx_call.
1256 (throw_bad_typeid): Likewise.
1257 (build_dynamic_cast_1): Likewise.
1258 * init.c (build_builtin_delete_call): Use build_call_n.
1259 * decl.c (expand_static_init): Likewise.
1260 * except.c (cp_protect_cleanup_actions): Likewise.
1261 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1262 (gimplify_must_not_throw_expr): Likewise.
1263 (cxx_omp_apply_fn): Use build_call_a.
1265 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1267 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1268 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1270 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1272 * cp-tree.h (static_ctors): Remove.
1273 * cp-tree.h (static_dtors): Likewise.
1274 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1275 refactoring of tree_map hierarchy.
1276 (decl_shadowed_for_var_insert): Likewise.
1277 * semantics.c (expand_body): Use c_expand_body.
1278 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1279 * decl2.c (static_ctors): Remove.
1280 (static_dtors): Likewise.
1281 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1282 objc_generate_static_init_call. Do not call static_[cd]tors.
1283 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1285 (cp_write_global_declarations): Likewise.
1287 2007-02-23 Richard Guenther <rguenther@suse.de>
1289 * class.c (note_name_declared_in_class): Make declaration
1290 changes meaning a pedwarn.
1292 2007-02-22 Michael Matz <matz@suse.de>
1295 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1296 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1297 dump_function_decl): Guard emitting outer scopes by new flag.
1298 * cp-lang.c (cxx_dwarf_name): New function.
1299 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1300 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1302 (push_template_decl_real, lookup_template_class): Remove calls
1305 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1307 * call.c (build_new_method_call): Ensure that explicit calls of
1308 destructors have type "void".
1310 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1312 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1313 and -Walways-true with -Waddress.
1314 * cvt.c (convert_to_void): Replace unconditional warning with
1317 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1319 * decl.c, tree.c: Fix comment typos.
1321 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1324 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1325 statement expression if we had an error mark node.
1327 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1328 Brooks Moses <brooks.moses@codesourcery.com>
1329 Lee Millward <lee.millward@codesourcery.com>
1331 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1332 Change class to tcc_vl_exp.
1334 * call.c (build_call): Use build_call_list instead
1336 (build_over_call): Likewise.
1337 (build_new_method_call): Use build_min_non_dep_call_list
1338 instead of build_min_non_dep.
1340 * error.c (dump_call_expr_args): New function.
1341 (dump_aggr_init_expr_args): New function.
1342 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1343 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1345 * cvt.c (convert_to_void): Use build_call_array instead
1346 of build3; use new AGGR_INIT_EXPR accessor macros.
1348 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1349 instead of TREE_CODE_LENGTH.
1351 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1352 AGGR_INIT_EXPR accessor macros.
1354 * cp-gimplify.c (cp_gimplify_init_expr): Use
1355 AGGR_INIT_EXPR_SLOT to set the slot operand.
1357 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1358 (AGGR_INIT_EXPR_SLOT): New macro.
1359 (AGGR_INIT_EXPR_ARG): New macro.
1360 (aggr_init_expr_nargs): New macro.
1361 (AGGR_INIT_EXPR_ARGP): New macro.
1362 (aggr_init_expr_arg_iterator): New.
1363 (init_aggr_init_expr_arg_iterator): New.
1364 (next_aggr_init_expr_arg): New.
1365 (first_aggr_init_expr_arg): New.
1366 (more_aggr_init_expr_args_p): New.
1367 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1368 (stabilize_aggr_init): New declaration.
1369 (build_min_non_dep_call_list): Likewise.
1371 * tree.c (process_aggr_init_operands): New function.
1372 (build_aggr_init_array) New function.
1373 (build_cplus_new): Update to use new CALL_EXPR and
1374 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1375 build_aggr_init_array.
1376 (build_min_non_dep_call_list) New function.
1377 (build_min_nt): Assert input code parameter is not a variable
1378 length expression class.
1379 (build_min, build_min_non_dep): Likewise.
1380 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1381 to check for equality instead of recursing. Handle tcc_vl_exp
1383 (stabilize_call): Update to only handle CALL_EXPRs, not
1384 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1385 (stabilize_aggr_init): New function.
1386 (stabilize_init): Use it.
1388 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1389 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1390 AGGR_INIT_EXPR accessor macros and argument iterators.
1392 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1393 build_vl_exp. Iterate through the operands, recursively
1394 processing each one.
1395 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1396 CALL_EXPR accessor macros.
1397 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1398 tree code classes. Use TREE_OPERAND_LENGTH instead of
1401 * semantics.c (finish_call_expr): Use build_nt_call_list
1402 instead of build_nt.
1403 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1404 accessor macros. Use build_call_array to construct the
1405 CALL_EXPR node instead of build3
1407 * decl2.c (build_offset_ref_call_from_tree): Use
1408 build_nt_call_list and build_min_non_dep_call_list instead
1409 of build_min_nt and build_min_non_dep.
1411 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1412 Use build_nt_call_list instead of build_min_nt.
1414 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1417 * call.c (build_conditional_expr): Improve error message.
1419 2007-02-13 Dirk Mueller <dmueller@suse.de>
1421 * friend.c (do_friend): Annotate warning about friend
1422 declarations in templates with OPT_Wnon_template_friend.
1423 Convert informal message from warning() to inform().
1425 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1426 Mark Mitchell <mark@codesourcery.com>
1429 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1430 instantiations for variables.
1432 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1435 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1436 Check warn_unused_value just once.
1438 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1441 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1442 (fn_type_unificiation): Likewise.
1443 (get_bindings): Likewise.
1445 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1448 * decl.c (finish_function): Use DECL_REPLACEABLE.
1449 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1451 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1453 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1455 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1457 * decl.c (grokvardecl): Don't error if !have_tls.
1458 (grokdeclarator): Likewise.
1459 * parser.c (cp_parser_omp_threadprivate): Likewise.
1461 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1464 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1465 parameters and result decls in omp clauses.
1466 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1469 2007-02-05 Dirk Mueller <dmueller@suse.de>
1472 * parser.c (cp_parser_class_specifier): Always initialize bases.
1474 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1476 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1477 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1478 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1480 * semantics.c (finish_omp_atomic): Store a whole expression node
1481 in operand 1, and integer_zero_node in operand 0, for dependent
1482 OMP_ATOMIC. Rewrite to make flow easier to understand.
1484 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1486 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1488 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1490 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1491 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1493 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1495 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1496 keyword warning to -Wc++0x-compat.
1498 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1500 * decl.c (grokdeclarator): Update documentation.
1502 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1505 * decl.c (grokdeclarator): If __thread is used together with
1506 a storage class other than extern and static, clear thread_p
1507 after issuing diagnostics and fall through to checking the
1510 2007-01-30 Roger Sayle <roger@eyesopen.com>
1512 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1513 calculating the size of an array (to avoid recursive errors).
1515 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1518 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1520 * call.c (convert_like_real): Don't warn when converting to
1523 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1525 * decl.c (pop_label): Replace warning with call to
1526 warn_for_unused_label.
1528 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1531 * semantics.c (finish_pseudo_destructor_expr): Check the
1532 destrutor name by calling check_dtor_name.
1534 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1536 * lex.c (D_CPP0X): Rename.
1538 (reswords): D_CPP0X -> D_CXX0X.
1539 (init_reswords): Ditto.
1540 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1541 of C++0x keywords as identifiers.
1543 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1546 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1549 2007-01-23 Ian Lance Taylor <iant@google.com>
1551 * typeck.c (convert_for_assignment): Only warn about a = b = c
1552 when converting to bool.
1554 2007-01-23 Roger Sayle <roger@eyesopen.com>
1556 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1558 * typeck.c (ignore_overflows): Remove the remaining uses of
1559 TREE_CONSTANT_OVERFLOW.
1561 2007-01-20 Jan Hubicka <jh@suse.cz>
1563 * decl2.c (start_objects, start_static_storage_duration_function):
1564 Do not make the functions uninlinable.
1566 2007-01-17 Ian Lance Taylor <iant@google.com>
1568 * class.c (add_method): Call VEC_reserve_exact rather than passing
1569 a negative size to VEC_reserve.
1571 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1574 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1576 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1579 * decl.c (make_typename_type): If the qualified name is not a
1580 type, issue an error.
1581 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1584 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1586 * rtti.c: Include target.h.
1587 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1588 don't emit typeinfo for fundamental types as weak.
1589 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1591 2007-01-08 Richard Guenther <rguenther@suse.de>
1593 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1595 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1597 * call.c (standard_conversion): Pass flag to
1598 vector_types_convertible_p to disallow emission of note.
1599 * typeck.c (convert_for_assignment): Pass flag to
1600 vector_types_convertible_p to allow emission of note.
1601 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1602 to disallow emission of note.
1604 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1607 * typeck.c (build_binary_op): Call overflow_warning if
1608 TREE_OVERFLOW_P is true for the result and not for any of the
1611 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1614 * class.c (add_method): Don't wait until template
1615 instantiation time to complain about duplicate methods.
1617 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1620 * semantics.c (finish_unary_op_expr): Warn only if result
1621 overflowed and operands did not.
1623 2007-01-05 Ian Lance Taylor <iant@google.com>
1625 * typeck.c (build_binary_op): Warn about comparing a non-weak
1628 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1630 * pt.c (tsubst): Propagate the need for structural equality checks
1631 when reducing the level of template parameters.
1633 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1635 * pt.c: Fix a comment typo.
1637 2007-01-02 Ian Lance Taylor <iant@google.com>
1639 * semantics.c (maybe_convert_cond): Optionally warn when using an
1640 assignment as a condition.
1641 * typeck.c (convert_for_assignment): Optionally warn about
1642 assigning the result of an assignment to a bool.
1644 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1646 * pt.c (canonical_template_parms): Correct typo in comment.
1648 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1650 * typeck.c (structural_comptypes): Renamed from "comptypes".
1651 (comptypes): Use canonical type information to perform fast type
1652 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1653 canonical type comparison returns the same results as we would see
1654 from the current, structural check. Support COMPARE_STRUCTURAL
1655 when we need structural checks.
1656 * decl.c (typename_compare): Fix comment.
1657 (build_typename_type): TYPENAME_TYPE nodes require structural
1658 equality checks, because they resolve different based on the
1660 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1661 require structural equality checks (for now).
1662 (build_ptrmemfunc_type): Build the canonical pointer to member
1664 (compute_array_index_type): Whenever we build a new index type
1665 to represent the size of an array in a template, we need to mark
1666 this index type as requiring structural equality. This goes for
1667 arrays with value-dependent sizes with the current ABI, or all
1669 * tree.c (cplus_array_hash): New.
1670 (struct cplus_array_info): New.
1671 (cplus_array_compare): New.
1672 (cplus_array_htab): New.
1673 (build_cplus_array_type_1): Use a hash table to cache the array
1674 types we build. Build the canonical array type for each array
1676 (cp_build_qualified_type_real): When building a cv-qualified array
1677 type, use the hash table of array types and build canonical array
1679 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1680 use structural equality (for now).
1681 * cp-tree.h (COMPARE_STRUCTURAL): New.
1682 * pt.c (canonical_template_parms): New.
1683 (canonical_type_parameter): New.
1684 (process_template_parm): Find the canonical type parameter.
1685 (lookup_template_class): When we have named the primary template
1686 type, set the canonical type for our template class to the primary
1687 template type. If any of the template arguments need structural
1688 equality checks, the template class needs structural equality
1690 (tsubst): When reducing the level of a template template
1691 parameter, we require structural equality tests for the resulting
1692 parameter because its template parameters have not had their types
1693 canonicalized. When reducing a template type parameter, find the
1694 canonical reduced type parameter.
1695 (any_template_arguments_need_structural_equality_p): New.