1 2007-07-24 Paolo Carlini <pcarlini@suse.de>
4 * typeck.c (check_return_expr): Do not pass a null argument
7 2007-07-24 Paolo Carlini <pcarlini@suse.de>
10 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
13 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
16 * typeck.c (convert_arguments): Only use default args if we have
20 * typeck.c (structural_comptypes): No need to check
21 resolve_typename_type return value here.
22 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
23 * pt.c (resolve_typename_type): Follow typename typedefs. Return
24 original type rather than error_mark_node in case of failure.
25 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
26 resolve_typename_type result check.
27 (cp_parser_direct_declarator, cp_parser_head,
28 cp_parser_constructor_declarator_p): Likewise.
30 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
32 * pt.c (template_parms_variadic_p): Remove.
33 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
35 2007-07-12 Jakub Jelinek <jakub@redhat.com>
38 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
39 argument to dump_aggr_init_expr_args instead of false.
41 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
43 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
44 canonical types; otherwise, fall back to structural type
45 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
46 internal compiler error if the canonical types are wrong.
48 2007-07-11 Paolo Carlini <pcarlini@suse.de>
51 * parser.c (cp_parser_make_indirect_declarator): When the
52 the code argument is ERROR_MARK return cp_error_declarator.
54 2007-07-09 Geoffrey Keating <geoffk@apple.com>
57 * decl.c (cxx_init_decl_processing): Don't set
58 force_align_functions_log.
59 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
60 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
61 FUNCTION_DECL, return its alignment.
63 2007-07-09 Richard Guenther <rguenther@suse.de>
65 * decl.c (start_preparsed_function): Do not promote return type.
67 2007-07-08 Paolo Carlini <pcarlini@suse.de>
70 * pt.c (unify): Never pass error_mark_node to template_decl_level.
72 2007-07-07 Mark Mitchell <mark@codesourcery.com>
75 * pt.c (resolve_overloaded_unification): Robustify. Return a
77 (type_unification_real): Adjust accordingly.
79 2007-07-06 Richard Guenther <rguenther@suse.de>
81 * init.c (build_new_1): Use the correct pointer type.
82 * typeck2.c (build_m_component_ref): Likewise.
84 2007-07-05 Mark Mitchell <mark@codesourcery.com>
87 * init.c (build_zero_init): Always build an initializer for
89 * typeck2.c (build_functional_cast): Use build_zero_init.
92 * init.c (build_new_1): Always pass the allocation function to
94 * call.c (build_op_delete_call): Handle operator delete with a
95 variable-argument list. Do not issue an error when no matching
96 deallocation function is available for a new operator.
99 * cp-tree.h (any_value_dependent_elements_p): Declare it.
100 * decl.c (value_dependent_init_p): New function.
101 (cp_finish_decl): Use it.
102 * pt.c (value_dependent_expression_p): Use
103 any_value_dependent_elements_p.
104 * parser.c (cp_parser_primary_expression): Add comment about
105 treating dependent qualified names as integral
106 constant-expressions.
108 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
110 * decl.c (build_ptrmemfunc_type): Always use structural equality
111 tests when comparing pointer-to-member-function types, because the
112 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
115 2007-07-03 Mark Mitchell <mark@codesourcery.com>
117 * init.c (build_new): Tweak comment.
119 2007-06-29 Dave Brolley <brolley@redhat.com>
122 * parser.c (cp_parser_new_type_id): Don't reduce a named array
123 type to its base type and number of elements here.
124 * init.c (build_new): Call complete_type_or_else to ensure that the
125 type is complete and to issue a diagnostic if it is not.
126 (build_new_1): Don't call complete_type_or_else here.
128 2007-07-03 Richard Guenther <rguenther@suse.de>
131 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
134 2007-07-02 Simon Baldwin <simonb@google.com>
136 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
137 for inner-style nested forward declarations that don't declare
140 2007-07-02 Jakub Jelinek <jakub@redhat.com>
143 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
144 DECL_P in not a variable and appears more than once error messages.
146 2007-07-01 Ollie Wild <aaw@google.com>
148 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
149 (select_decl): Remove function.
150 (unqualified_namespace_lookup): Populate binding by calling
151 ambiguous_decl. Remove select_decl call.
152 (lookup_qualified_name): Remove select_decl call.
153 * decl.c (lookup_and_check_tag): Check for ambiguous references.
154 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
155 generation when name lookup is ambiguous.
157 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
160 * init.c (build_new_1): Use structural equality on the copy of the
163 2007-06-28 Geoffrey Keating <geoffk@apple.com>
165 * decl2.c (determine_visibility): Implement
166 flag_visibility_ms_compat effect on type info.
167 * decl.c (cxx_init_decl_processing): Implement
168 global effect of flag_visibility_ms_compat.
170 2007-06-28 Geoffrey Keating <geoffk@apple.com>
172 * decl2.c (start_objects): Mark constructor-running function
175 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
178 * decl.c (grokdeclarator): Reset friendp for member functions declared
179 friend of their own class.
181 2007-06-23 Mark Mitchell <mark@codesourcery.com>
183 * decl2.c (determine_visibility): Don't look for dllexport here.
184 (determine_visibility_from_class): Tidy.
186 2007-06-18 Simon Baldwin <simonb@google.com>
189 * parser.c (cp_parser_single_declaration): Added check for storage
190 class other than sc_none in parsed declaration, and a flag to indicate
191 if the call is part of an explicit template specialization parse.
192 * (cp_parser_explicit_specialization): Specialization check flag added
193 to call to cp_parser_single_declaration(), set true.
194 * (cp_parser_template_declaration_after_export): Specialization check
195 flag added to call to cp_parser_single_declaration(), set false.
196 * pt.c (check_explicit_specialization): Added code to copy visiblity
197 and linkage from the templated function to the explicit specialization.
199 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
201 * typeck.c (build_binary_op): For templates build the
202 expression in pieces to avoid the assert in build2_stat.
203 (get_member_function_from_ptrfunc):
204 Change over to using POINTER_PLUS_EXPR and convert
205 the second operand to sizetype.
206 * typeck2.c (build_m_component_ref): Likewise.
207 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
208 instead of PLUS_EXPR for pointers.
209 (build_new_1): Likewise.
210 (build_vec_delete_1): Likewise.
211 (build_vec_delete): Likewise.
212 * class.c (build_base_path): Likewise.
213 (build_base_path): Likewise.
214 (convert_to_base_statically): Likewise.
215 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
216 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
217 instead of PLUS_EXPR.
218 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
219 instead of PLUS_EXPR for pointers.
220 * call.c (build_special_member_call): Likewise.
221 * rtti.c (build_headof): Likewise.
222 Use sizetype instead of ptrdiff_type_node.
223 (tinfo_base_init): Create a POINTER_PLUS_EXPR
224 instead of PLUS_EXPR for pointers.
225 * except.c (expand_start_catch_block): Do a
226 NEGATIVE and then a POINTER_PLUS_EXPR instead
228 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
229 PLUS_EXPR on pointer types over to use
230 POINTER_PLUS_EXPR and remove the conversion
231 to the pointer types.
232 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
233 adding to a pointer type. Use size_int instead of
234 ssize_int. Convert the index to sizetype before
235 adding it to the pointer.
237 2007-06-15 Mark Mitchell <mark@codesourcery.com>
239 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
240 (DECL_ANON_UNION_VAR_P): New macro.
241 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
242 than DECL_VAR_MARKED_P, to keep track of which variables we have
244 * decl.c (redeclaration_error_message): Complain about redeclaring
245 anonymous union members at namespace scope.
246 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
248 2007-06-14 Geoff Keating <geoffk@apple.com>
250 * decl2.c (determine_visibility): Ensure that functions with
251 hidden types as parameters are hidden.
254 * decl2.c (determine_visibility): Remove duplicate code for
257 2007-06-12 Ian Lance Taylor <iant@google.com>
260 * init.c (avoid_placement_new_aliasing): New static function.
261 (build_new_1): Call it.
263 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
265 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
266 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
268 2007-06-08 Jakub Jelinek <jakub@redhat.com>
271 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
272 on init, the non-decl cond operand and increment value.
274 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
277 * decl.c (check_initializer): Report an error when a brace enclosed
278 initializer is used for a non-aggregate type in C++98.
279 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
281 (grokdeclarator): Likewise.
282 (move_fn_p): Likewise.
283 * typeck.c (check_return_expr): Likewise.
284 * call.c (reference_binding): Likewise.
285 * error.c (cp_cpp_error): Likewise.
286 * pt.c (check_default_tmpl_args): Likewise.
288 * lex.c (init_reswords): Likewise.
289 * parser.c (p_parser_primary_expression): Likewise.
290 (TOKEN_PRECEDENCE): Likewise.
291 (cp_parser_init_declarator): Likewise.
292 (cp_parser_ptr_operator): Likewise.
293 (cp_parser_parameter_declaration): Likewise.
294 (cp_parser_enclosed_template_argument_list): Likewise.
295 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
296 (cp_parser_next_token_ends_template_argument_p): Likewise.
298 2007-06-04 Simon Baldwin <simonb@google.com>
300 * decl.c (grokdeclarator): Readability change. Moved case labels
301 into direct switch statement scope.
303 2007-06-04 Paolo Carlini <pcarlini@suse.de>
305 * call.c (convert_like_real): Remove pointless code.
307 2007-05-31 Mark Mitchell <mark@codesourcery.com>
309 * decl.c (get_atexit_fn_ptr_type): New function.
310 (get_atexit_node): Use it.
311 (start_cleanup_fn): Likewise.
312 (register_dtor_fn): Use the object's destructor, instead of a
313 separate cleanup function, where possible.
314 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
315 (atexit_fn_ptr_type_node): New macro.
316 * decl2.c (build_cleanup): Use build_address.
318 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
320 * typeck.c (build_binary_op): Include types in error.
322 2007-05-31 Jakub Jelinek <jakub@redhat.com>
325 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
326 needs runtime initialization.
328 2007-05-31 Paolo Carlini <pcarlini@suse.de>
331 * semantics.c (finish_trait_expr): Complete the types.
333 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
334 Douglas Gregor <doug.gregor@gmail.com>
335 Pedro Lamarao <pedro.lamarao@mndfck.org>
336 Howard Hinnant <howard.hinnant@gmail.com>
340 * typeck.c (comptypes): Don't consider rvalue and lvalue
341 reference types to be equivalent.
342 (check_return_expr): Move from certain lvalues when returning
344 * decl.c (grokdeclarator): Implement reference collapsing.
345 (copy_fn_p): Don't consider constructors taking rvalue references
346 to be copy constructors.
348 * call.c (conversion): New "rvaluedness_matches_p" member.
349 (convert_class_to_reference): Require reference type as first
350 parameter instead of base type.
351 (reference_binding): Add logic to handle rvalue references.
352 (implicit_conversion): Update inaccurate comment.
353 (convert_like_real): Disable creation of temporaries that are
354 impossible to initialize for types with move constructors.
355 (build_over_call): Elide move constructors when possible.
356 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
357 (maybe_handle_ref_bind): Return conversion instead of type node.
358 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
359 determine preferred conversion sequences.
360 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
361 (LOOKUP_PREFER_RVALUE): New.
362 (DECL_MOVE_CONSTRUCTOR_P): New.
363 (struct cp_declarator): Add "reference" member for reference
364 types, with new "rvalue_ref" flag.
365 (cp_build_reference_type): Declare.
366 (move_fn_p): Declare.
367 * error.c (dump_type_prefix): Format rvalue reference types
368 correctly in error messages.
369 * except.c (build_throw): Move from certain lvalues when
371 * mangle.c (write_type): Mangle rvalue references differently
372 than regular references.
373 * parser.c (make_reference_declarator): Add boolean parameter for
375 (cp_parser_make_indirect_declarator): New.
376 (cp_parser_new_declarator_opt): Call
377 cp_parser_make_indirect_declarator.
378 (cp_parser_conversion_declarator_opt): Ditto.
379 (cp_parser_declarator): Ditto.
380 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
382 * pt.c (tsubst): Implement reference collapsing.
383 (maybe_adjust_types_for_deduction): Implement special template
384 parameter deduction rule for rvalue references.
385 (type_unification_real): Update calls to
386 maybe_adjust_types_for_deduction.
387 (try_one_overload): Ditto.
388 (unify_pack_expansion): Ditto.
389 * tree.c (lvalue_p_1): Handle rvalue reference types.
390 (cp_build_reference_type): New.
392 2007-05-30 Jakub Jelinek <jakub@redhat.com>
395 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
396 variables that need runtime initialization.
398 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
401 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
402 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
403 case POSTDECREMENT_EXPR>): Return the error_mark_node
404 if either the real or imaginary parts would an
407 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
408 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
411 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
412 token is a closing brace, false if there are no tokens left.
413 (cp_parser_namespace_alias_definition): Only consume the next token if
414 it is a closing brace.
416 * parser.c (cp_parser_class_specifier): Likewise.
418 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
420 * semantics.c (finish_member_declaration): Fix a typo in the
423 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
435 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
436 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
437 * pt.c (check_for_bare_parameter_packs): Return bool indicated
438 whether everything was okay. Fix indentation.
439 (push_template_decl_real): Check for bare parameter packs in
440 function parameters; where errors occur, mark the parameter types
441 with ERROR_MARK_NODEs to avert ICEs.
442 (coerce_template_parameter_pack): New.
443 (coerce_template_parms): Moved parameter pack coercion into
444 coerce_template_parameter_pack, and permit it anywhere in the
445 template parameter list (not just at the end). Parameter and
446 argument indices can vary (somewhat) separately now, so add
447 PARM_IDX and ARG_IDX.
448 (fn_type_unification): Don't set an argument pack as incomplete if
449 no argument pack was deduced.
450 (type_unification_real): If a type parameter is a parameter pack
451 and has not otherwise been deduced, it will be deduced to an empty
453 (more_specialized_fn): Use the actual lengths of the argument
454 lists when comparing against expansions.
455 * semantics.c (finish_member_declaration): If a field's type has
456 bare parameter packs, error and set its type to ERROR_MARK_NODE.
458 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
461 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
463 2007-05-22 Ollie Wild <aaw@google.com>
465 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
466 (unqualified_namespace_lookup): Adds check for hidden types.
468 2007-05-22 Ollie Wild <aaw@google.com>
470 * decl.c (duplicate_decls): Verify namespace names are unique.
472 2007-05-21 Mark Mitchell <mark@codesourcery.com>
474 * decl.c (cxx_maybe_build_cleanup): Handle
475 __attribute__((cleanup)).
477 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
479 * cvt.c (cp_convert_and_check): Don't check warnings if the
482 2007-05-18 Geoffrey Keating <geoffk@apple.com>
484 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
486 2007-05-14 Paolo Carlini <pcarlini@suse.de>
489 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
490 type only if is a class type (5.2.8/4).
492 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
494 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
495 * decl.c (grokdeclarator): Use unsigned_type_for instead of
496 c_common_unsigned_type.
498 2007-05-11 Silvius Rus <rus@google.com>
500 * cp/typeck.c (build_indirect_ref): Add call to
501 strict_aliasing_warning.
502 (build_reinterpret_cast_1): Condition call to
503 strict_aliasing_warning.
505 2007-05-11 Jan Hubicka <jh@suse.cz>
507 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
508 * decl2.c (start_objects): ctors and dtors are no longer public.
509 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
511 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
513 * typeck.c (build_unary_op): Remove code that used to
514 handle non lvalue increments/decrements.
516 2007-05-07 Mike Stump <mrs@apple.com>
518 * parser.c (check_empty_body): Add.
519 (cp_parser_iteration_statement): Add call to check_empty_body.
521 2007-05-05 Geoffrey Keating <geoffk@apple.com>
524 * mangle.c (write_mangled_name): Mangle static variable names.
525 (write_unqualified_name): Use local-source-name for
526 namespace-scope static variables.
528 2007-05-04 Dirk Mueller <dmueller@suse.de>
530 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
533 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
536 * decl2.c (constrain_class_visibility):
537 Use strip_pointer_or_array_types instead of strip_array_types.
539 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
542 * decl.c (reshape_init_r): Don't reshape the first element if it
543 is a pointer to member function.
545 2007-04-27 Simon Baldwin <simonb@google.com>
547 * decl.c (grokparms): Changed message format from %qD to %qE.
549 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
551 * error.c (maybe_warn_variadic_templates): Variadic templates are
552 now in C++0x, so only warn about them in C++98 mode.
554 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
557 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
558 integeral types from vectors types.
560 2007-04-26 Jakub Jelinek <jakub@redhat.com>
563 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
564 for type dependent OMP_CLAUSE_DECLs.
566 2007-04-24 Mark Mitchell <mark@codesourcery.com>
569 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
570 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
571 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
572 * init.c (build_zero_init): Adjust, as
573 COMPLEX_TYPE is now a SCALAR_TYPE.
574 * typeck2.c (digest_init): Allow brace-enclosed initializers for
575 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
577 2007-04-25 Paolo Carlini <pcarlini@suse.de>
579 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
580 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
581 (trait_expr_value): Adjust.
583 2007-04-23 Simon Baldwin <simonb@google.com>
585 * decl.c (grokparms): Added new error for duplicate function
586 parameters names in function prototypes, to match gcc behavior.
588 2007-04-23 Jan Hubicka <jh@suse.cz>
590 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
593 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
595 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
596 instead of checking GIMPLE_STMT_P in chain_next.
598 2007-04-17 Mark Mitchell <mark@codesourcery.com>
601 * call.c (convert_for_arg_passing): Convert bitfields to their
604 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
607 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
609 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
613 * cp/decl2.c (constrain_class_visibility):
614 Do not warn about the use of anonymous namespace in the main input file.
616 2007-04-15 Mark Mitchell <mark@codesourcery.com>
618 * cp-tree.h (current_template_parms): Fix typo in comment.
620 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
622 * cp-tree.h, error.c: Fix comment typos.
624 2007-04-13 Jason Merrill <jason@redhat.com>
627 * call.c (reference_binding): Add c_cast_p parm. If true,
628 add quals to TO as needed to make it reference-compatible.
630 2007-04-11 Jan Hubicka <jh@suse.cz>
632 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
633 that we are not processing template_decl.
635 2007-04-09 Mark Mitchell <mark@codesourcery.com>
638 * class.c (build_base_path): Ensure that the converted pointer has
639 the same cv-qualification as the input.
641 2007-04-09 Paolo Carlini <pcarlini@suse.de>
643 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
645 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
647 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
649 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
650 * tree.c (cp_add_pending_fn_decls): Remove.
651 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
653 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
655 Revert change removing staticp.
657 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
659 * cp-objcp-common.c (cxx_staticp): Remove.
660 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
661 * cp-tree.h (cxx_staticp):
663 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
665 * class.c (check_for_override): Don't remove dllmport attribute
668 2007-04-03 Jakub Jelinek <jakub@redhat.com>
671 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
672 type issue error and return early.
674 2007-03-30 Jason Merrill <jason@redhat.com>
677 * typeck.c (cp_type_readonly): New fn.
678 * cp-tree.h: Declare it.
679 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
680 (cp_finish_decl): Not here.
682 2007-03-31 Richard Guenther <rguenther@suse.de>
684 * optimize.c (maybe_clone_body): Replace splay-tree usage by
687 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
692 * parser.c (declarator_can_be_parameter_pack): New.
693 (cp_parser_template_parameter): Only parse the `...' if the
694 declarator can be a parameter pack.
695 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
697 * pt.c (find_parameter_packs_r): Look into the bounds on integer
698 types (they could be used as array bounds).
699 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
700 (tsubst_pack_expansion): Handle failure to expand parameter
703 2007-03-30 Paolo Carlini <pcarlini@suse.de>
706 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
707 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
708 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
709 (CLASS_TYPE_NON_UNION_P): Add.
710 (struct lang_type_class): Add has_complex_dflt.
711 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
712 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
713 * cp-tree.def: Add TRAIT_EXPR.
714 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
715 * lex.c (struct resword): Add __has_nothrow_assign,
716 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
717 __has_trivial_constructor, __has_trivial_copy,
718 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
719 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
720 __is_pod, __is_polymorphic, __is_union.
721 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
722 (cp_parser_trait_expr): New.
723 * semantics.c (finish_trait_expr, trait_expr_value
724 classtype_has_nothrow_copy_or_assign_p): New.
725 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
727 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
728 * class.c (check_bases, check_field_decl, check_bases_and_members):
729 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
730 * pt.c (uses_template_parms, tsubst_copy_and_build,
731 value_dependent_expression_p, type_dependent_expression_p): Deal with
733 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
735 2007-03-29 Richard Guenther <rguenther@suse.de>
737 * tree.c (cp_walk_subtrees): Do not set input_location.
739 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
742 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
745 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
747 * parser.c (struct cp_parser): Update comment for
748 greater_than_is_operator_p.
749 (cp_parser_primary_expression): In C++0x mode, a cast operator can
750 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
751 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
752 !GREATER_THAN_IS_OPERATOR_P.
753 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
754 `>>' operators that will become two `>' tokens in C++0x.
755 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
756 mode, allowing it to terminate default arguments.
757 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
758 `>>' like two consecutive `>' tokens.
759 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
760 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
761 ends a template argument.
763 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
765 * decl.c (redeclaration_error_message): Complain when redeclaring
766 a friend function with default template arguments (C++0x mode only).
767 * cp-tree.h (check_default_tmpl_args): Declare.
768 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
769 template arguments in function templates. Add support for checking
770 the default template arguments of friend templates.
771 (push_template_decl_real): Fix call to check_default_tmpl_args.
772 (type_unification_real): If a template parameter has not been
773 deduced but provides a default template argument, substitute into
774 that default template argument.
775 * parser.c (cp_parser_init_declarator): When declaring (but not
776 defining!) a function template in C++0x mode, check for default
779 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
782 * decl.c (grokdeclarator): Deal with cv-qualified function type
783 typedefs in the same way for member and non-member functions.
785 2007-03-26 Dirk Mueller <dmueller@suse.de>
787 * parser.c (cp_parser_member_declaration): Pedwarn
788 about stray semicolons after member declarations.
790 2007-03-26 Paolo Carlini <pcarlini@suse.de>
793 * pt.c (instantiate_decl): Set in_system_header.
795 2007-03-22 Mark Mitchell <mark@codesourcery.com>
797 * cp-tree.h (current_tempalte_parms): Improve documentation.
798 * pt.c (current_template_args): Likewise.
801 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
802 not consume tokens when failing.
804 2007-03-22 Jim Wilson <wilson@specifix.com>
805 Mark Mitchell <mark@codesourcery.com>
808 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
809 consistent with FROM.
811 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
813 * error.c (dump_expr): Handle dependent names that designate types.
814 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
816 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
818 * cp-tree.def, parser.c, pt.c: Fix comment typos.
820 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
822 * cvt.c (cp_convert_and_check) : Define.
823 * cp-tree.h (cp_convert_and_check): Declare.
824 * call.c (convert_conversion_warnings): Rename to
825 conversion_null_warnings. The warning for floating-point to
826 integer is handled by convert_and_check in convert_like_real.
827 (convert_like_real): convert_conversion_warnings was renamed as
828 conversion_null_warnings.
829 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
830 overflow and changes of value during conversion.
832 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
835 * parser.c (cp_parser_statement): If 'namespace' is found, this
836 only can be a namespace alias definition, so parse it now.
837 (cp_parser_namespace_alias_definition): if we find an open brace
838 instead of '=', then this is actually a misplaced namespace
841 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
844 * decl.c (cxx_init_decl_processing): Move command-line options
845 processing to c-opts.c.
847 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
849 * ptree.c (cxx_print_type): Use formatting markup for integers
850 when printing template parameter index/level/orig level.
851 (cxx_print_xnode): Ditto.
852 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
853 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
854 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
856 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
857 rather than a HOST_WIDE_INT.
858 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
859 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
861 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
862 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
863 IN_BASE_INITIALIZER bool bitfields.
864 (struct cp_declarator): Make KIND a 4-bit field. Make
865 PARAMETER_PACK_P a bool bitfield just after KIND.
866 * pt.c (uses_parameter_packs): Destroy the pointer set.
867 (make_pack_expansion): Ditto.
868 (check_for_bare_parameter_packs): Ditto.
869 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
871 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
874 * call.c (convert_default_arg): Instead of copying the node,
877 2007-03-15 Dirk Mueller <dmueller@suse.de>
880 * call.c (convert_conversion_warnings): New..
881 (convert_like_real): .. factored out from here.
882 (convert_conversion_warnings): Add warning about
883 false being converted to NULL in argument passing.
885 2007-03-14 Dirk Mueller <dmueller@suse.de>
887 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
888 (finish_do_body): Warn about empty body in do/while statement.
890 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
892 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
894 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
897 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
900 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
902 * cp/repo.c (init_repo): Initialize random_seed saved options.
903 (finish_repo): Adjust.
905 2007-03-13 Mark Mitchell <mark@codesourcery.com>
908 * Make-lang.in (doc/g++.1): Use $< to specify the location from
911 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
913 * decl.c (compute_array_index_type): New warning flag warn_vla.
915 2007-03-12 Mark Mitchell <mark@codesourcery.com>
918 * call.c (convert_default_arg): Copy non-constant arguments.
920 2007-03-11 Mark Mitchell <mark@codesourcery.com>
923 * parser.c (cp_parser_postfix_expression): Disallow compound
924 literals in constant expressions.
927 * semantics.c (finish_typeof): Use unlowered_expr_type.
929 2007-03-10 Mark Mitchell <mark@codesourcery.com>
932 * cp-tree.h (unlowered_expr_type): New function.
933 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
934 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
935 (unlowered_expr_type): New function.
936 (build_unary_op): Disallow predecrements of bool bitfields.
937 * call.c (build_conditional_expr): Use unlowered_expr_type.
938 * pt.c (type_unification_real): Likewise.
940 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
943 * typeck.c (check_return_expr): Check for bare parameter packs.
944 (comptypes): Compare template parameter packs and
945 type pack expansions.
946 * decl.c (grokdeclarator): Deal with the declaration of function
948 (grokparms): Verify that the (optional) function parameter pack is
949 at the end of the parameter list.
950 (xref_basetypes): Handle pack expansions in the base class.
951 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
952 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
953 (NONTYPE_ARGUMENT_PACK): New.
954 (TYPE_PACK_EXPANSION): New.
955 (EXPR_PACK_EXPANSION): New.
956 (ARGUMENT_PACK_SELECT): New.
957 * cp-objcp-common.c (cp_tree_size): Compute size of
958 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
959 ARGUMENT_PACK_SELECT.
960 * error.c (dump_template_argument): Print template argument packs.
961 (dump_template_argument_list): Ditto.
962 (dump_template_parameter): Dump `...' for template type parameter
964 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
965 (dump_parameters): Print function parameter packs.
966 (dump_template_parms): Print template argument packs.
967 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
968 (maybe_warn_variadic_templates): New.
969 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
970 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
971 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
973 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
974 (write_template_arg): Write argument packs as separate arguments.
975 * cp-tree.h (struct template_parm_index_s): Add flag that
976 indicates that the template parameter is actually a parameter
978 (struct tree_argument_pack_select): New.
979 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
980 (union lang_tree_node): Add argument_pack_select.
981 (FUNCTION_PARAMETER_PACK_P): New.
982 (PACK_EXPANSION_P): New.
983 (PACK_EXPANSION_PATTERN): New.
984 (SET_PACK_EXPANSION_PATTERN): New.
985 (PACK_EXPANSION_PARAMETER_PACKS): New.
986 (ARGUMENT_PACK_P): New.
987 (ARGUMENT_PACK_ARGS): New.
988 (SET_ARGUMENT_PACK_ARGS): New.
989 (ARGUMENT_PACK_INCOMPLETE_P): New.
990 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
991 (TEMPLATE_PARM_PARAMETER_PACK): New.
992 (TEMPLATE_TYPE_PARAMETER_PACK): New.
993 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
994 (ARGUMENT_PACK_SELECT_INDEX): New.
995 (ARGUMENT_PACK_SELECT_ARG): New.
996 (struct cp_declarator): Add parameter_pack_p flag.
997 (maybe_warn_variadic_templates): Declare.
998 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
999 indicate a template parameter pack.
1000 (uses_parameter_packs): Declare.
1001 (template_parameter_pack_p): Declare.
1002 (template_parms_variadic_p): Declare.
1003 (make_pack_expansion): Declare.
1004 (check_for_bare_parameter_packs): Declare.
1005 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1006 sizeof... expressions.
1007 (pp_cxx_expression): Print pack expansions and non-type argument
1009 (pp_cxx_exception_specification): Print pack expansions.
1010 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1011 (pp_cxx_ctor_initializer): Print pack expansions.
1012 (pp_cxx_type_id): Print pack expansions.
1013 (pp_cxx_template_argument_list): Print argument packs.
1014 (pp_cxx_template_parameter): Print ellipsis for template parameter
1016 * pt.c (comp_template_parms): Compare template parameter packs.
1017 (template_parameter_pack_p): New.
1018 (template_parms_variadic_p): New.
1019 (template_args_variadic_p): New.
1020 (make_ith_pack_parameter_name): New.
1021 (struct find_parameter_pack_data): New.
1022 (find_parameter_packs_r): New.
1023 (uses_parameter_packs): New.
1024 (make_pack_expansion): New.
1025 (check_for_bare_parameter_packs): New.
1026 (expand_template_argument_pack): New.
1027 (reduce_template_parm_level): Propagate parameter pack flag.
1028 (process_template_parm): Add is_parameter_pack parameter to state
1029 when the parameter is actually a parameter pack. Create template
1030 parameter packs when is_parameter_pack is true.
1031 (current_template_args): The argument for a template parameter
1032 pack is an argument pack containing a single pack expansion.
1033 (process_partial_specialization): When checking that non-type
1034 argument expressions do not involve template parameters, loop over
1035 the arguments in argument packs separately.
1036 (push_template_decl_real): Check that the type of the declaration
1037 does not have any bare parameter packs. Check that primary
1038 templates have no more than one parameter pack, and that it comes
1039 at the end of the template parameter list.
1040 (convert_template_argument): Handle coercions for pack expansion
1041 expressions by coercing the pattern then rebuilding the expansion.
1042 (coerce_template_parms): When coercing the arguments for a
1043 variadic template, pack "extra" arguments into an argument pack.
1044 (coerce_template_template_parms): Cannot coerce between parameter
1045 packs and non-pack parameters.
1046 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1047 (comp_template_args): Expand all template arguments packs before
1048 comparing template argument lists.
1049 (mangle_class_name_for_template): Make argument packs as separate
1051 (for_each_template_parm_r): No need to handle BASELINK.
1052 (instantiate_class_template): Handle pack expansions in the base
1054 (tsubst_pack_expansion): New.
1055 (tsubst_template_args): Handle substitutions of argument packs and
1056 pack expansion into template argument lists.
1057 (tsubst_decl): Expand function parameter packs into separate
1058 function parameters.
1059 (tsubst_arg_types): Expand a type pack expansion into separate
1061 (tsubst_exception_specification): Handle pack expansions in
1062 exception specifiers.
1063 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1064 replacing a template parameter with its argument. If we encounter
1065 a substitution for an argument pack, just return the parameter
1067 (tsubst_copy): sizeof(X...) returns the number of elements in
1068 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1069 PARM_DECL is a parameter pack.
1070 (tsubst_expr): Expression pack expansions and argument packs
1071 cannot show up here; they will all be handled through function
1072 calls, sizeof, and template argument lists.
1073 (tsubst_copy_and_build): sizeof(X...) returns the number of
1074 elements in parameter pack X. Handle pack expansions in TREE_LIST
1075 and CONSTRUCTOR nodes.
1076 (fn_type_unification): Handle "incomplete" explicit template
1077 argument lists that specify some of the arguments for a template
1079 (type_unification_real): Unify arguments against pack expansions.
1080 (template_parm_level_and_index): New, helper function.
1081 (unify_pack_expansion): New.
1082 (unify): Unify argument packs on an argument-by-argument basis,
1083 handling variadic argument packs as well.
1084 (more_specialized_fn): Handle unification of function parameter
1085 packs. All things being equal, prefer non-variadic function
1086 templates to variadic function templates.
1087 (more_specialized_class): Prefer the variadic class template
1088 partial specialization that binds fewer arguments to a parameter
1090 (regenerate_decl_from_template): Expand function parameter packs
1091 into separate parameters.
1092 (instantiate_decl): Ditto.
1093 (tsubst_initializer_list): Handle pack expansions for base-class
1095 (dependent_type_p_r): Determine dependent types in argument packs
1096 and pack expansions.
1097 (value_dependent_expression_p): Determine value-dependence of
1098 non-type argument packs.
1099 (dependent_template_arg_p): Handle argument packs.
1100 * semantics.c (finish_cond): Check for bare parameter packs.
1101 (finish_expr_stmt): Ditto.
1102 (finish_for_expr): Ditto.
1103 (finish_switch_cond): Ditto.
1104 (finish_mem_initializers): Ditto.
1105 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1107 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1108 * parser.c (make_declarator): Declarator is not an expansion.
1109 (make_pointer_declarator): Transfer parameter pack flag to outer
1111 (make_reference_declarator): Ditto.
1112 (make_ptrmem_declarator): Ditto.
1113 (make_call_declarator): Ditto.
1114 (make_array_declarator): Ditto.
1115 (cp_parser_postfix_expression): Allow pack expansion expressions
1116 in the argument list for a call expression.
1117 (cp_parser_parenthesized_expression_list): Add new parameter
1118 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1119 into separate arguments."
1120 (cp_parser_new_placement): Allow pack expansion expressions.
1121 (cp_parser_new_initializer): Ditto.
1122 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1123 base-class initializer expansion.
1124 (cp_parser_mem_initializer): Ditto.
1125 (cp_parser_template_parameter_list): Keep track of whether the
1126 template parameter is a template parameter pack.
1127 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1128 template parameter pack.
1129 (cp_parser_type_parameter): Ditto.
1130 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1132 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1133 this declarator is a parameter pack.
1134 (cp_parser_parameter_declaration): The ellipsis does not end the
1135 parameter declaration, because it might be a parameter pack. Parse
1136 the ellipsis to indicate a parameter pack.
1137 (cp_parser_initializer): Allow pack expansions.
1138 (cp_parser_initializer_list): Allow ellipsis to create an
1139 initializer expansion.
1140 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1142 (cp_parser_type_id_list): Allow ellipsis to create an exception
1143 specifier expansion.
1144 (cp_parser_attribute_list): Don't allow pack expansions.
1145 (cp_parser_functional_cast): Allow pack expansions.
1146 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1147 compute the length of a parameter pack.
1148 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1149 end a template argument.
1150 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1151 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1154 2007-03-09 Dirk Mueller <dmueller@suse.de>
1156 * cp/call.c (build_new_op): Call warn_logical_operator.
1158 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1161 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1164 * pt.c (any_template_arguments_need_structural_equality_p):
1167 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1169 * decl.c (grokdeclarator): Disable warnings for anonymous
1172 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1174 * typeck2.c (readonly_error): Always emit a hard error.
1175 Remove last argument.
1176 * cp-tree.h (readonly_error): Adjust prototype.
1177 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1178 * typeck.c (build_unary_op): Likewise.
1179 (build_modify_expr): Likewise.
1181 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1184 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1186 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1189 * parser.c (struct cp_parser): New IN_IF_STMT.
1190 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1191 returning if parsing the body of an 'if' statement or issuing an
1192 error and continuing.
1193 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1195 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1197 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1200 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1203 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1205 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1206 Objective-C++. Don't exit early if -shared-libgcc needs to be
1209 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1211 * typeck.c (common_base_type): Delete unused function.
1213 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1215 * Make-lang.in: Add dummy lang.install-pdf target.
1217 2007-03-01 Simon Baldwin <simonb@google.com>
1220 * decl.c (check_tag_decl): Added new warning for typedef ignored
1221 when it precedes an otherwise valid non-typedef declaration.
1223 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1225 * typeck.c (build_function_call): Store converted arguments
1226 in a stack-allocated array instead of building a list.
1227 (convert_arguments): Store arguments in the array passed in as an
1228 argument, and return the actual number of arguments.
1229 * call.c (build_call): Delete, and replace with...
1230 (build_call_n, build_call_a): New.
1231 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1232 (build_over_call): Store converted arguments in a stack-allocated
1233 array instead of building a list.
1234 (build_cxx_call): Pass arguments in an array instead of as a list.
1235 (build_java_interface_fn_ref): Rewrite to avoid constructing
1237 * tree.h: Update declarations to reflect above changes.
1238 * method.c (use_thunk): Use a stack-allocated array to hold
1239 the arguments instead of a list.
1240 * rtti.c (throw_bad_cast): Update call to cxx_call.
1241 (throw_bad_typeid): Likewise.
1242 (build_dynamic_cast_1): Likewise.
1243 * init.c (build_builtin_delete_call): Use build_call_n.
1244 * decl.c (expand_static_init): Likewise.
1245 * except.c (cp_protect_cleanup_actions): Likewise.
1246 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1247 (gimplify_must_not_throw_expr): Likewise.
1248 (cxx_omp_apply_fn): Use build_call_a.
1250 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1252 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1253 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1255 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1257 * cp-tree.h (static_ctors): Remove.
1258 * cp-tree.h (static_dtors): Likewise.
1259 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1260 refactoring of tree_map hierarchy.
1261 (decl_shadowed_for_var_insert): Likewise.
1262 * semantics.c (expand_body): Use c_expand_body.
1263 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1264 * decl2.c (static_ctors): Remove.
1265 (static_dtors): Likewise.
1266 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1267 objc_generate_static_init_call. Do not call static_[cd]tors.
1268 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1270 (cp_write_global_declarations): Likewise.
1272 2007-02-23 Richard Guenther <rguenther@suse.de>
1274 * class.c (note_name_declared_in_class): Make declaration
1275 changes meaning a pedwarn.
1277 2007-02-22 Michael Matz <matz@suse.de>
1280 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1281 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1282 dump_function_decl): Guard emitting outer scopes by new flag.
1283 * cp-lang.c (cxx_dwarf_name): New function.
1284 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1285 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1287 (push_template_decl_real, lookup_template_class): Remove calls
1290 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1292 * call.c (build_new_method_call): Ensure that explicit calls of
1293 destructors have type "void".
1295 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1297 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1298 and -Walways-true with -Waddress.
1299 * cvt.c (convert_to_void): Replace unconditional warning with
1302 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1304 * decl.c, tree.c: Fix comment typos.
1306 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1309 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1310 statement expression if we had an error mark node.
1312 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1313 Brooks Moses <brooks.moses@codesourcery.com>
1314 Lee Millward <lee.millward@codesourcery.com>
1316 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1317 Change class to tcc_vl_exp.
1319 * call.c (build_call): Use build_call_list instead
1321 (build_over_call): Likewise.
1322 (build_new_method_call): Use build_min_non_dep_call_list
1323 instead of build_min_non_dep.
1325 * error.c (dump_call_expr_args): New function.
1326 (dump_aggr_init_expr_args): New function.
1327 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1328 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1330 * cvt.c (convert_to_void): Use build_call_array instead
1331 of build3; use new AGGR_INIT_EXPR accessor macros.
1333 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1334 instead of TREE_CODE_LENGTH.
1336 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1337 AGGR_INIT_EXPR accessor macros.
1339 * cp-gimplify.c (cp_gimplify_init_expr): Use
1340 AGGR_INIT_EXPR_SLOT to set the slot operand.
1342 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1343 (AGGR_INIT_EXPR_SLOT): New macro.
1344 (AGGR_INIT_EXPR_ARG): New macro.
1345 (aggr_init_expr_nargs): New macro.
1346 (AGGR_INIT_EXPR_ARGP): New macro.
1347 (aggr_init_expr_arg_iterator): New.
1348 (init_aggr_init_expr_arg_iterator): New.
1349 (next_aggr_init_expr_arg): New.
1350 (first_aggr_init_expr_arg): New.
1351 (more_aggr_init_expr_args_p): New.
1352 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1353 (stabilize_aggr_init): New declaration.
1354 (build_min_non_dep_call_list): Likewise.
1356 * tree.c (process_aggr_init_operands): New function.
1357 (build_aggr_init_array) New function.
1358 (build_cplus_new): Update to use new CALL_EXPR and
1359 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1360 build_aggr_init_array.
1361 (build_min_non_dep_call_list) New function.
1362 (build_min_nt): Assert input code parameter is not a variable
1363 length expression class.
1364 (build_min, build_min_non_dep): Likewise.
1365 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1366 to check for equality instead of recursing. Handle tcc_vl_exp
1368 (stabilize_call): Update to only handle CALL_EXPRs, not
1369 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1370 (stabilize_aggr_init): New function.
1371 (stabilize_init): Use it.
1373 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1374 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1375 AGGR_INIT_EXPR accessor macros and argument iterators.
1377 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1378 build_vl_exp. Iterate through the operands, recursively
1379 processing each one.
1380 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1381 CALL_EXPR accessor macros.
1382 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1383 tree code classes. Use TREE_OPERAND_LENGTH instead of
1386 * semantics.c (finish_call_expr): Use build_nt_call_list
1387 instead of build_nt.
1388 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1389 accessor macros. Use build_call_array to construct the
1390 CALL_EXPR node instead of build3
1392 * decl2.c (build_offset_ref_call_from_tree): Use
1393 build_nt_call_list and build_min_non_dep_call_list instead
1394 of build_min_nt and build_min_non_dep.
1396 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1397 Use build_nt_call_list instead of build_min_nt.
1399 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1402 * call.c (build_conditional_expr): Improve error message.
1404 2007-02-13 Dirk Mueller <dmueller@suse.de>
1406 * friend.c (do_friend): Annotate warning about friend
1407 declarations in templates with OPT_Wnon_template_friend.
1408 Convert informal message from warning() to inform().
1410 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1411 Mark Mitchell <mark@codesourcery.com>
1414 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1415 instantiations for variables.
1417 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1420 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1421 Check warn_unused_value just once.
1423 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1426 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1427 (fn_type_unificiation): Likewise.
1428 (get_bindings): Likewise.
1430 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1433 * decl.c (finish_function): Use DECL_REPLACEABLE.
1434 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1436 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1438 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1440 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1442 * decl.c (grokvardecl): Don't error if !have_tls.
1443 (grokdeclarator): Likewise.
1444 * parser.c (cp_parser_omp_threadprivate): Likewise.
1446 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1449 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1450 parameters and result decls in omp clauses.
1451 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1454 2007-02-05 Dirk Mueller <dmueller@suse.de>
1457 * parser.c (cp_parser_class_specifier): Always initialize bases.
1459 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1461 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1462 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1463 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1465 * semantics.c (finish_omp_atomic): Store a whole expression node
1466 in operand 1, and integer_zero_node in operand 0, for dependent
1467 OMP_ATOMIC. Rewrite to make flow easier to understand.
1469 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1471 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1473 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1475 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1476 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1478 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1480 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1481 keyword warning to -Wc++0x-compat.
1483 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1485 * decl.c (grokdeclarator): Update documentation.
1487 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1490 * decl.c (grokdeclarator): If __thread is used together with
1491 a storage class other than extern and static, clear thread_p
1492 after issuing diagnostics and fall through to checking the
1495 2007-01-30 Roger Sayle <roger@eyesopen.com>
1497 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1498 calculating the size of an array (to avoid recursive errors).
1500 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1503 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1505 * call.c (convert_like_real): Don't warn when converting to
1508 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1510 * decl.c (pop_label): Replace warning with call to
1511 warn_for_unused_label.
1513 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1516 * semantics.c (finish_pseudo_destructor_expr): Check the
1517 destrutor name by calling check_dtor_name.
1519 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1521 * lex.c (D_CPP0X): Rename.
1523 (reswords): D_CPP0X -> D_CXX0X.
1524 (init_reswords): Ditto.
1525 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1526 of C++0x keywords as identifiers.
1528 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1531 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1534 2007-01-23 Ian Lance Taylor <iant@google.com>
1536 * typeck.c (convert_for_assignment): Only warn about a = b = c
1537 when converting to bool.
1539 2007-01-23 Roger Sayle <roger@eyesopen.com>
1541 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1543 * typeck.c (ignore_overflows): Remove the remaining uses of
1544 TREE_CONSTANT_OVERFLOW.
1546 2007-01-20 Jan Hubicka <jh@suse.cz>
1548 * decl2.c (start_objects, start_static_storage_duration_function):
1549 Do not make the functions uninlinable.
1551 2007-01-17 Ian Lance Taylor <iant@google.com>
1553 * class.c (add_method): Call VEC_reserve_exact rather than passing
1554 a negative size to VEC_reserve.
1556 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1559 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1561 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1564 * decl.c (make_typename_type): If the qualified name is not a
1565 type, issue an error.
1566 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1569 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1571 * rtti.c: Include target.h.
1572 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1573 don't emit typeinfo for fundamental types as weak.
1574 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1576 2007-01-08 Richard Guenther <rguenther@suse.de>
1578 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1580 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1582 * call.c (standard_conversion): Pass flag to
1583 vector_types_convertible_p to disallow emission of note.
1584 * typeck.c (convert_for_assignment): Pass flag to
1585 vector_types_convertible_p to allow emission of note.
1586 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1587 to disallow emission of note.
1589 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1592 * typeck.c (build_binary_op): Call overflow_warning if
1593 TREE_OVERFLOW_P is true for the result and not for any of the
1596 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1599 * class.c (add_method): Don't wait until template
1600 instantiation time to complain about duplicate methods.
1602 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1605 * semantics.c (finish_unary_op_expr): Warn only if result
1606 overflowed and operands did not.
1608 2007-01-05 Ian Lance Taylor <iant@google.com>
1610 * typeck.c (build_binary_op): Warn about comparing a non-weak
1613 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1615 * pt.c (tsubst): Propagate the need for structural equality checks
1616 when reducing the level of template parameters.
1618 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1620 * pt.c: Fix a comment typo.
1622 2007-01-02 Ian Lance Taylor <iant@google.com>
1624 * semantics.c (maybe_convert_cond): Optionally warn when using an
1625 assignment as a condition.
1626 * typeck.c (convert_for_assignment): Optionally warn about
1627 assigning the result of an assignment to a bool.
1629 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1631 * pt.c (canonical_template_parms): Correct typo in comment.
1633 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1635 * typeck.c (structural_comptypes): Renamed from "comptypes".
1636 (comptypes): Use canonical type information to perform fast type
1637 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1638 canonical type comparison returns the same results as we would see
1639 from the current, structural check. Support COMPARE_STRUCTURAL
1640 when we need structural checks.
1641 * decl.c (typename_compare): Fix comment.
1642 (build_typename_type): TYPENAME_TYPE nodes require structural
1643 equality checks, because they resolve different based on the
1645 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1646 require structural equality checks (for now).
1647 (build_ptrmemfunc_type): Build the canonical pointer to member
1649 (compute_array_index_type): Whenever we build a new index type
1650 to represent the size of an array in a template, we need to mark
1651 this index type as requiring structural equality. This goes for
1652 arrays with value-dependent sizes with the current ABI, or all
1654 * tree.c (cplus_array_hash): New.
1655 (struct cplus_array_info): New.
1656 (cplus_array_compare): New.
1657 (cplus_array_htab): New.
1658 (build_cplus_array_type_1): Use a hash table to cache the array
1659 types we build. Build the canonical array type for each array
1661 (cp_build_qualified_type_real): When building a cv-qualified array
1662 type, use the hash table of array types and build canonical array
1664 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1665 use structural equality (for now).
1666 * cp-tree.h (COMPARE_STRUCTURAL): New.
1667 * pt.c (canonical_template_parms): New.
1668 (canonical_type_parameter): New.
1669 (process_template_parm): Find the canonical type parameter.
1670 (lookup_template_class): When we have named the primary template
1671 type, set the canonical type for our template class to the primary
1672 template type. If any of the template arguments need structural
1673 equality checks, the template class needs structural equality
1675 (tsubst): When reducing the level of a template template
1676 parameter, we require structural equality tests for the resulting
1677 parameter because its template parameters have not had their types
1678 canonicalized. When reducing a template type parameter, find the
1679 canonical reduced type parameter.
1680 (any_template_arguments_need_structural_equality_p): New.