1 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
3 * pt.c (template_parms_variadic_p): Remove.
4 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
6 2007-07-12 Jakub Jelinek <jakub@redhat.com>
9 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
10 argument to dump_aggr_init_expr_args instead of false.
12 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
14 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
15 canonical types; otherwise, fall back to structural type
16 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
17 internal compiler error if the canonical types are wrong.
19 2007-07-11 Paolo Carlini <pcarlini@suse.de>
22 * parser.c (cp_parser_make_indirect_declarator): When the
23 the code argument is ERROR_MARK return cp_error_declarator.
25 2007-07-09 Geoffrey Keating <geoffk@apple.com>
28 * decl.c (cxx_init_decl_processing): Don't set
29 force_align_functions_log.
30 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
31 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
32 FUNCTION_DECL, return its alignment.
34 2007-07-09 Richard Guenther <rguenther@suse.de>
36 * decl.c (start_preparsed_function): Do not promote return type.
38 2007-07-08 Paolo Carlini <pcarlini@suse.de>
41 * pt.c (unify): Never pass error_mark_node to template_decl_level.
43 2007-07-07 Mark Mitchell <mark@codesourcery.com>
46 * pt.c (resolve_overloaded_unification): Robustify. Return a
48 (type_unification_real): Adjust accordingly.
50 2007-07-06 Richard Guenther <rguenther@suse.de>
52 * init.c (build_new_1): Use the correct pointer type.
53 * typeck2.c (build_m_component_ref): Likewise.
55 2007-07-05 Mark Mitchell <mark@codesourcery.com>
58 * init.c (build_zero_init): Always build an initializer for
60 * typeck2.c (build_functional_cast): Use build_zero_init.
63 * init.c (build_new_1): Always pass the allocation function to
65 * call.c (build_op_delete_call): Handle operator delete with a
66 variable-argument list. Do not issue an error when no matching
67 deallocation function is available for a new operator.
70 * cp-tree.h (any_value_dependent_elements_p): Declare it.
71 * decl.c (value_dependent_init_p): New function.
72 (cp_finish_decl): Use it.
73 * pt.c (value_dependent_expression_p): Use
74 any_value_dependent_elements_p.
75 * parser.c (cp_parser_primary_expression): Add comment about
76 treating dependent qualified names as integral
79 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
81 * decl.c (build_ptrmemfunc_type): Always use structural equality
82 tests when comparing pointer-to-member-function types, because the
83 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
86 2007-07-03 Mark Mitchell <mark@codesourcery.com>
88 * init.c (build_new): Tweak comment.
90 2007-06-29 Dave Brolley <brolley@redhat.com>
93 * parser.c (cp_parser_new_type_id): Don't reduce a named array
94 type to its base type and number of elements here.
95 * init.c (build_new): Call complete_type_or_else to ensure that the
96 type is complete and to issue a diagnostic if it is not.
97 (build_new_1): Don't call complete_type_or_else here.
99 2007-07-03 Richard Guenther <rguenther@suse.de>
102 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
105 2007-07-02 Simon Baldwin <simonb@google.com>
107 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
108 for inner-style nested forward declarations that don't declare
111 2007-07-02 Jakub Jelinek <jakub@redhat.com>
114 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
115 DECL_P in not a variable and appears more than once error messages.
117 2007-07-01 Ollie Wild <aaw@google.com>
119 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
120 (select_decl): Remove function.
121 (unqualified_namespace_lookup): Populate binding by calling
122 ambiguous_decl. Remove select_decl call.
123 (lookup_qualified_name): Remove select_decl call.
124 * decl.c (lookup_and_check_tag): Check for ambiguous references.
125 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
126 generation when name lookup is ambiguous.
128 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
131 * init.c (build_new_1): Use structural equality on the copy of the
134 2007-06-28 Geoffrey Keating <geoffk@apple.com>
136 * decl2.c (determine_visibility): Implement
137 flag_visibility_ms_compat effect on type info.
138 * decl.c (cxx_init_decl_processing): Implement
139 global effect of flag_visibility_ms_compat.
141 2007-06-28 Geoffrey Keating <geoffk@apple.com>
143 * decl2.c (start_objects): Mark constructor-running function
146 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
149 * decl.c (grokdeclarator): Reset friendp for member functions declared
150 friend of their own class.
152 2007-06-23 Mark Mitchell <mark@codesourcery.com>
154 * decl2.c (determine_visibility): Don't look for dllexport here.
155 (determine_visibility_from_class): Tidy.
157 2007-06-18 Simon Baldwin <simonb@google.com>
160 * parser.c (cp_parser_single_declaration): Added check for storage
161 class other than sc_none in parsed declaration, and a flag to indicate
162 if the call is part of an explicit template specialization parse.
163 * (cp_parser_explicit_specialization): Specialization check flag added
164 to call to cp_parser_single_declaration(), set true.
165 * (cp_parser_template_declaration_after_export): Specialization check
166 flag added to call to cp_parser_single_declaration(), set false.
167 * pt.c (check_explicit_specialization): Added code to copy visiblity
168 and linkage from the templated function to the explicit specialization.
170 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
172 * typeck.c (build_binary_op): For templates build the
173 expression in pieces to avoid the assert in build2_stat.
174 (get_member_function_from_ptrfunc):
175 Change over to using POINTER_PLUS_EXPR and convert
176 the second operand to sizetype.
177 * typeck2.c (build_m_component_ref): Likewise.
178 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
179 instead of PLUS_EXPR for pointers.
180 (build_new_1): Likewise.
181 (build_vec_delete_1): Likewise.
182 (build_vec_delete): Likewise.
183 * class.c (build_base_path): Likewise.
184 (build_base_path): Likewise.
185 (convert_to_base_statically): Likewise.
186 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
187 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
188 instead of PLUS_EXPR.
189 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
190 instead of PLUS_EXPR for pointers.
191 * call.c (build_special_member_call): Likewise.
192 * rtti.c (build_headof): Likewise.
193 Use sizetype instead of ptrdiff_type_node.
194 (tinfo_base_init): Create a POINTER_PLUS_EXPR
195 instead of PLUS_EXPR for pointers.
196 * except.c (expand_start_catch_block): Do a
197 NEGATIVE and then a POINTER_PLUS_EXPR instead
199 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
200 PLUS_EXPR on pointer types over to use
201 POINTER_PLUS_EXPR and remove the conversion
202 to the pointer types.
203 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
204 adding to a pointer type. Use size_int instead of
205 ssize_int. Convert the index to sizetype before
206 adding it to the pointer.
208 2007-06-15 Mark Mitchell <mark@codesourcery.com>
210 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
211 (DECL_ANON_UNION_VAR_P): New macro.
212 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
213 than DECL_VAR_MARKED_P, to keep track of which variables we have
215 * decl.c (redeclaration_error_message): Complain about redeclaring
216 anonymous union members at namespace scope.
217 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
219 2007-06-14 Geoff Keating <geoffk@apple.com>
221 * decl2.c (determine_visibility): Ensure that functions with
222 hidden types as parameters are hidden.
225 * decl2.c (determine_visibility): Remove duplicate code for
228 2007-06-12 Ian Lance Taylor <iant@google.com>
231 * init.c (avoid_placement_new_aliasing): New static function.
232 (build_new_1): Call it.
234 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
236 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
237 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
239 2007-06-08 Jakub Jelinek <jakub@redhat.com>
242 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
243 on init, the non-decl cond operand and increment value.
245 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
248 * decl.c (check_initializer): Report an error when a brace enclosed
249 initializer is used for a non-aggregate type in C++98.
250 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
252 (grokdeclarator): Likewise.
253 (move_fn_p): Likewise.
254 * typeck.c (check_return_expr): Likewise.
255 * call.c (reference_binding): Likewise.
256 * error.c (cp_cpp_error): Likewise.
257 * pt.c (check_default_tmpl_args): Likewise.
259 * lex.c (init_reswords): Likewise.
260 * parser.c (p_parser_primary_expression): Likewise.
261 (TOKEN_PRECEDENCE): Likewise.
262 (cp_parser_init_declarator): Likewise.
263 (cp_parser_ptr_operator): Likewise.
264 (cp_parser_parameter_declaration): Likewise.
265 (cp_parser_enclosed_template_argument_list): Likewise.
266 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
267 (cp_parser_next_token_ends_template_argument_p): Likewise.
269 2007-06-04 Simon Baldwin <simonb@google.com>
271 * decl.c (grokdeclarator): Readability change. Moved case labels
272 into direct switch statement scope.
274 2007-06-04 Paolo Carlini <pcarlini@suse.de>
276 * call.c (convert_like_real): Remove pointless code.
278 2007-05-31 Mark Mitchell <mark@codesourcery.com>
280 * decl.c (get_atexit_fn_ptr_type): New function.
281 (get_atexit_node): Use it.
282 (start_cleanup_fn): Likewise.
283 (register_dtor_fn): Use the object's destructor, instead of a
284 separate cleanup function, where possible.
285 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
286 (atexit_fn_ptr_type_node): New macro.
287 * decl2.c (build_cleanup): Use build_address.
289 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
291 * typeck.c (build_binary_op): Include types in error.
293 2007-05-31 Jakub Jelinek <jakub@redhat.com>
296 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
297 needs runtime initialization.
299 2007-05-31 Paolo Carlini <pcarlini@suse.de>
302 * semantics.c (finish_trait_expr): Complete the types.
304 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
305 Douglas Gregor <doug.gregor@gmail.com>
306 Pedro Lamarao <pedro.lamarao@mndfck.org>
307 Howard Hinnant <howard.hinnant@gmail.com>
311 * typeck.c (comptypes): Don't consider rvalue and lvalue
312 reference types to be equivalent.
313 (check_return_expr): Move from certain lvalues when returning
315 * decl.c (grokdeclarator): Implement reference collapsing.
316 (copy_fn_p): Don't consider constructors taking rvalue references
317 to be copy constructors.
319 * call.c (conversion): New "rvaluedness_matches_p" member.
320 (convert_class_to_reference): Require reference type as first
321 parameter instead of base type.
322 (reference_binding): Add logic to handle rvalue references.
323 (implicit_conversion): Update inaccurate comment.
324 (convert_like_real): Disable creation of temporaries that are
325 impossible to initialize for types with move constructors.
326 (build_over_call): Elide move constructors when possible.
327 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
328 (maybe_handle_ref_bind): Return conversion instead of type node.
329 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
330 determine preferred conversion sequences.
331 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
332 (LOOKUP_PREFER_RVALUE): New.
333 (DECL_MOVE_CONSTRUCTOR_P): New.
334 (struct cp_declarator): Add "reference" member for reference
335 types, with new "rvalue_ref" flag.
336 (cp_build_reference_type): Declare.
337 (move_fn_p): Declare.
338 * error.c (dump_type_prefix): Format rvalue reference types
339 correctly in error messages.
340 * except.c (build_throw): Move from certain lvalues when
342 * mangle.c (write_type): Mangle rvalue references differently
343 than regular references.
344 * parser.c (make_reference_declarator): Add boolean parameter for
346 (cp_parser_make_indirect_declarator): New.
347 (cp_parser_new_declarator_opt): Call
348 cp_parser_make_indirect_declarator.
349 (cp_parser_conversion_declarator_opt): Ditto.
350 (cp_parser_declarator): Ditto.
351 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
353 * pt.c (tsubst): Implement reference collapsing.
354 (maybe_adjust_types_for_deduction): Implement special template
355 parameter deduction rule for rvalue references.
356 (type_unification_real): Update calls to
357 maybe_adjust_types_for_deduction.
358 (try_one_overload): Ditto.
359 (unify_pack_expansion): Ditto.
360 * tree.c (lvalue_p_1): Handle rvalue reference types.
361 (cp_build_reference_type): New.
363 2007-05-30 Jakub Jelinek <jakub@redhat.com>
366 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
367 variables that need runtime initialization.
369 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
372 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
373 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
374 case POSTDECREMENT_EXPR>): Return the error_mark_node
375 if either the real or imaginary parts would an
378 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
379 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
382 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
383 token is a closing brace, false if there are no tokens left.
384 (cp_parser_namespace_alias_definition): Only consume the next token if
385 it is a closing brace.
387 * parser.c (cp_parser_class_specifier): Likewise.
389 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
391 * semantics.c (finish_member_declaration): Fix a typo in the
394 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
406 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
407 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
408 * pt.c (check_for_bare_parameter_packs): Return bool indicated
409 whether everything was okay. Fix indentation.
410 (push_template_decl_real): Check for bare parameter packs in
411 function parameters; where errors occur, mark the parameter types
412 with ERROR_MARK_NODEs to avert ICEs.
413 (coerce_template_parameter_pack): New.
414 (coerce_template_parms): Moved parameter pack coercion into
415 coerce_template_parameter_pack, and permit it anywhere in the
416 template parameter list (not just at the end). Parameter and
417 argument indices can vary (somewhat) separately now, so add
418 PARM_IDX and ARG_IDX.
419 (fn_type_unification): Don't set an argument pack as incomplete if
420 no argument pack was deduced.
421 (type_unification_real): If a type parameter is a parameter pack
422 and has not otherwise been deduced, it will be deduced to an empty
424 (more_specialized_fn): Use the actual lengths of the argument
425 lists when comparing against expansions.
426 * semantics.c (finish_member_declaration): If a field's type has
427 bare parameter packs, error and set its type to ERROR_MARK_NODE.
429 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
432 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
434 2007-05-22 Ollie Wild <aaw@google.com>
436 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
437 (unqualified_namespace_lookup): Adds check for hidden types.
439 2007-05-22 Ollie Wild <aaw@google.com>
441 * decl.c (duplicate_decls): Verify namespace names are unique.
443 2007-05-21 Mark Mitchell <mark@codesourcery.com>
445 * decl.c (cxx_maybe_build_cleanup): Handle
446 __attribute__((cleanup)).
448 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
450 * cvt.c (cp_convert_and_check): Don't check warnings if the
453 2007-05-18 Geoffrey Keating <geoffk@apple.com>
455 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
457 2007-05-14 Paolo Carlini <pcarlini@suse.de>
460 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
461 type only if is a class type (5.2.8/4).
463 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
465 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
466 * decl.c (grokdeclarator): Use unsigned_type_for instead of
467 c_common_unsigned_type.
469 2007-05-11 Silvius Rus <rus@google.com>
471 * cp/typeck.c (build_indirect_ref): Add call to
472 strict_aliasing_warning.
473 (build_reinterpret_cast_1): Condition call to
474 strict_aliasing_warning.
476 2007-05-11 Jan Hubicka <jh@suse.cz>
478 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
479 * decl2.c (start_objects): ctors and dtors are no longer public.
480 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
482 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
484 * typeck.c (build_unary_op): Remove code that used to
485 handle non lvalue increments/decrements.
487 2007-05-07 Mike Stump <mrs@apple.com>
489 * parser.c (check_empty_body): Add.
490 (cp_parser_iteration_statement): Add call to check_empty_body.
492 2007-05-05 Geoffrey Keating <geoffk@apple.com>
495 * mangle.c (write_mangled_name): Mangle static variable names.
496 (write_unqualified_name): Use local-source-name for
497 namespace-scope static variables.
499 2007-05-04 Dirk Mueller <dmueller@suse.de>
501 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
504 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
507 * decl2.c (constrain_class_visibility):
508 Use strip_pointer_or_array_types instead of strip_array_types.
510 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
513 * decl.c (reshape_init_r): Don't reshape the first element if it
514 is a pointer to member function.
516 2007-04-27 Simon Baldwin <simonb@google.com>
518 * decl.c (grokparms): Changed message format from %qD to %qE.
520 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
522 * error.c (maybe_warn_variadic_templates): Variadic templates are
523 now in C++0x, so only warn about them in C++98 mode.
525 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
528 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
529 integeral types from vectors types.
531 2007-04-26 Jakub Jelinek <jakub@redhat.com>
534 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
535 for type dependent OMP_CLAUSE_DECLs.
537 2007-04-24 Mark Mitchell <mark@codesourcery.com>
540 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
541 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
542 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
543 * init.c (build_zero_init): Adjust, as
544 COMPLEX_TYPE is now a SCALAR_TYPE.
545 * typeck2.c (digest_init): Allow brace-enclosed initializers for
546 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
548 2007-04-25 Paolo Carlini <pcarlini@suse.de>
550 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
551 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
552 (trait_expr_value): Adjust.
554 2007-04-23 Simon Baldwin <simonb@google.com>
556 * decl.c (grokparms): Added new error for duplicate function
557 parameters names in function prototypes, to match gcc behavior.
559 2007-04-23 Jan Hubicka <jh@suse.cz>
561 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
564 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
566 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
567 instead of checking GIMPLE_STMT_P in chain_next.
569 2007-04-17 Mark Mitchell <mark@codesourcery.com>
572 * call.c (convert_for_arg_passing): Convert bitfields to their
575 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
578 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
580 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
584 * cp/decl2.c (constrain_class_visibility):
585 Do not warn about the use of anonymous namespace in the main input file.
587 2007-04-15 Mark Mitchell <mark@codesourcery.com>
589 * cp-tree.h (current_template_parms): Fix typo in comment.
591 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
593 * cp-tree.h, error.c: Fix comment typos.
595 2007-04-13 Jason Merrill <jason@redhat.com>
598 * call.c (reference_binding): Add c_cast_p parm. If true,
599 add quals to TO as needed to make it reference-compatible.
601 2007-04-11 Jan Hubicka <jh@suse.cz>
603 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
604 that we are not processing template_decl.
606 2007-04-09 Mark Mitchell <mark@codesourcery.com>
609 * class.c (build_base_path): Ensure that the converted pointer has
610 the same cv-qualification as the input.
612 2007-04-09 Paolo Carlini <pcarlini@suse.de>
614 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
616 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
618 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
620 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
621 * tree.c (cp_add_pending_fn_decls): Remove.
622 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
624 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
626 Revert change removing staticp.
628 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
630 * cp-objcp-common.c (cxx_staticp): Remove.
631 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
632 * cp-tree.h (cxx_staticp):
634 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
636 * class.c (check_for_override): Don't remove dllmport attribute
639 2007-04-03 Jakub Jelinek <jakub@redhat.com>
642 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
643 type issue error and return early.
645 2007-03-30 Jason Merrill <jason@redhat.com>
648 * typeck.c (cp_type_readonly): New fn.
649 * cp-tree.h: Declare it.
650 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
651 (cp_finish_decl): Not here.
653 2007-03-31 Richard Guenther <rguenther@suse.de>
655 * optimize.c (maybe_clone_body): Replace splay-tree usage by
658 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
663 * parser.c (declarator_can_be_parameter_pack): New.
664 (cp_parser_template_parameter): Only parse the `...' if the
665 declarator can be a parameter pack.
666 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
668 * pt.c (find_parameter_packs_r): Look into the bounds on integer
669 types (they could be used as array bounds).
670 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
671 (tsubst_pack_expansion): Handle failure to expand parameter
674 2007-03-30 Paolo Carlini <pcarlini@suse.de>
677 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
678 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
679 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
680 (CLASS_TYPE_NON_UNION_P): Add.
681 (struct lang_type_class): Add has_complex_dflt.
682 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
683 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
684 * cp-tree.def: Add TRAIT_EXPR.
685 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
686 * lex.c (struct resword): Add __has_nothrow_assign,
687 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
688 __has_trivial_constructor, __has_trivial_copy,
689 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
690 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
691 __is_pod, __is_polymorphic, __is_union.
692 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
693 (cp_parser_trait_expr): New.
694 * semantics.c (finish_trait_expr, trait_expr_value
695 classtype_has_nothrow_copy_or_assign_p): New.
696 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
698 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
699 * class.c (check_bases, check_field_decl, check_bases_and_members):
700 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
701 * pt.c (uses_template_parms, tsubst_copy_and_build,
702 value_dependent_expression_p, type_dependent_expression_p): Deal with
704 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
706 2007-03-29 Richard Guenther <rguenther@suse.de>
708 * tree.c (cp_walk_subtrees): Do not set input_location.
710 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
713 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
716 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
718 * parser.c (struct cp_parser): Update comment for
719 greater_than_is_operator_p.
720 (cp_parser_primary_expression): In C++0x mode, a cast operator can
721 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
722 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
723 !GREATER_THAN_IS_OPERATOR_P.
724 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
725 `>>' operators that will become two `>' tokens in C++0x.
726 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
727 mode, allowing it to terminate default arguments.
728 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
729 `>>' like two consecutive `>' tokens.
730 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
731 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
732 ends a template argument.
734 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
736 * decl.c (redeclaration_error_message): Complain when redeclaring
737 a friend function with default template arguments (C++0x mode only).
738 * cp-tree.h (check_default_tmpl_args): Declare.
739 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
740 template arguments in function templates. Add support for checking
741 the default template arguments of friend templates.
742 (push_template_decl_real): Fix call to check_default_tmpl_args.
743 (type_unification_real): If a template parameter has not been
744 deduced but provides a default template argument, substitute into
745 that default template argument.
746 * parser.c (cp_parser_init_declarator): When declaring (but not
747 defining!) a function template in C++0x mode, check for default
750 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
753 * decl.c (grokdeclarator): Deal with cv-qualified function type
754 typedefs in the same way for member and non-member functions.
756 2007-03-26 Dirk Mueller <dmueller@suse.de>
758 * parser.c (cp_parser_member_declaration): Pedwarn
759 about stray semicolons after member declarations.
761 2007-03-26 Paolo Carlini <pcarlini@suse.de>
764 * pt.c (instantiate_decl): Set in_system_header.
766 2007-03-22 Mark Mitchell <mark@codesourcery.com>
768 * cp-tree.h (current_tempalte_parms): Improve documentation.
769 * pt.c (current_template_args): Likewise.
772 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
773 not consume tokens when failing.
775 2007-03-22 Jim Wilson <wilson@specifix.com>
776 Mark Mitchell <mark@codesourcery.com>
779 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
780 consistent with FROM.
782 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
784 * error.c (dump_expr): Handle dependent names that designate types.
785 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
787 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
789 * cp-tree.def, parser.c, pt.c: Fix comment typos.
791 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
793 * cvt.c (cp_convert_and_check) : Define.
794 * cp-tree.h (cp_convert_and_check): Declare.
795 * call.c (convert_conversion_warnings): Rename to
796 conversion_null_warnings. The warning for floating-point to
797 integer is handled by convert_and_check in convert_like_real.
798 (convert_like_real): convert_conversion_warnings was renamed as
799 conversion_null_warnings.
800 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
801 overflow and changes of value during conversion.
803 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
806 * parser.c (cp_parser_statement): If 'namespace' is found, this
807 only can be a namespace alias definition, so parse it now.
808 (cp_parser_namespace_alias_definition): if we find an open brace
809 instead of '=', then this is actually a misplaced namespace
812 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
815 * decl.c (cxx_init_decl_processing): Move command-line options
816 processing to c-opts.c.
818 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
820 * ptree.c (cxx_print_type): Use formatting markup for integers
821 when printing template parameter index/level/orig level.
822 (cxx_print_xnode): Ditto.
823 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
824 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
825 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
827 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
828 rather than a HOST_WIDE_INT.
829 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
830 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
832 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
833 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
834 IN_BASE_INITIALIZER bool bitfields.
835 (struct cp_declarator): Make KIND a 4-bit field. Make
836 PARAMETER_PACK_P a bool bitfield just after KIND.
837 * pt.c (uses_parameter_packs): Destroy the pointer set.
838 (make_pack_expansion): Ditto.
839 (check_for_bare_parameter_packs): Ditto.
840 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
842 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
845 * call.c (convert_default_arg): Instead of copying the node,
848 2007-03-15 Dirk Mueller <dmueller@suse.de>
851 * call.c (convert_conversion_warnings): New..
852 (convert_like_real): .. factored out from here.
853 (convert_conversion_warnings): Add warning about
854 false being converted to NULL in argument passing.
856 2007-03-14 Dirk Mueller <dmueller@suse.de>
858 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
859 (finish_do_body): Warn about empty body in do/while statement.
861 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
863 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
865 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
868 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
871 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
873 * cp/repo.c (init_repo): Initialize random_seed saved options.
874 (finish_repo): Adjust.
876 2007-03-13 Mark Mitchell <mark@codesourcery.com>
879 * Make-lang.in (doc/g++.1): Use $< to specify the location from
882 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
884 * decl.c (compute_array_index_type): New warning flag warn_vla.
886 2007-03-12 Mark Mitchell <mark@codesourcery.com>
889 * call.c (convert_default_arg): Copy non-constant arguments.
891 2007-03-11 Mark Mitchell <mark@codesourcery.com>
894 * parser.c (cp_parser_postfix_expression): Disallow compound
895 literals in constant expressions.
898 * semantics.c (finish_typeof): Use unlowered_expr_type.
900 2007-03-10 Mark Mitchell <mark@codesourcery.com>
903 * cp-tree.h (unlowered_expr_type): New function.
904 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
905 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
906 (unlowered_expr_type): New function.
907 (build_unary_op): Disallow predecrements of bool bitfields.
908 * call.c (build_conditional_expr): Use unlowered_expr_type.
909 * pt.c (type_unification_real): Likewise.
911 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
914 * typeck.c (check_return_expr): Check for bare parameter packs.
915 (comptypes): Compare template parameter packs and
916 type pack expansions.
917 * decl.c (grokdeclarator): Deal with the declaration of function
919 (grokparms): Verify that the (optional) function parameter pack is
920 at the end of the parameter list.
921 (xref_basetypes): Handle pack expansions in the base class.
922 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
923 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
924 (NONTYPE_ARGUMENT_PACK): New.
925 (TYPE_PACK_EXPANSION): New.
926 (EXPR_PACK_EXPANSION): New.
927 (ARGUMENT_PACK_SELECT): New.
928 * cp-objcp-common.c (cp_tree_size): Compute size of
929 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
930 ARGUMENT_PACK_SELECT.
931 * error.c (dump_template_argument): Print template argument packs.
932 (dump_template_argument_list): Ditto.
933 (dump_template_parameter): Dump `...' for template type parameter
935 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
936 (dump_parameters): Print function parameter packs.
937 (dump_template_parms): Print template argument packs.
938 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
939 (maybe_warn_variadic_templates): New.
940 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
941 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
942 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
944 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
945 (write_template_arg): Write argument packs as separate arguments.
946 * cp-tree.h (struct template_parm_index_s): Add flag that
947 indicates that the template parameter is actually a parameter
949 (struct tree_argument_pack_select): New.
950 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
951 (union lang_tree_node): Add argument_pack_select.
952 (FUNCTION_PARAMETER_PACK_P): New.
953 (PACK_EXPANSION_P): New.
954 (PACK_EXPANSION_PATTERN): New.
955 (SET_PACK_EXPANSION_PATTERN): New.
956 (PACK_EXPANSION_PARAMETER_PACKS): New.
957 (ARGUMENT_PACK_P): New.
958 (ARGUMENT_PACK_ARGS): New.
959 (SET_ARGUMENT_PACK_ARGS): New.
960 (ARGUMENT_PACK_INCOMPLETE_P): New.
961 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
962 (TEMPLATE_PARM_PARAMETER_PACK): New.
963 (TEMPLATE_TYPE_PARAMETER_PACK): New.
964 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
965 (ARGUMENT_PACK_SELECT_INDEX): New.
966 (ARGUMENT_PACK_SELECT_ARG): New.
967 (struct cp_declarator): Add parameter_pack_p flag.
968 (maybe_warn_variadic_templates): Declare.
969 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
970 indicate a template parameter pack.
971 (uses_parameter_packs): Declare.
972 (template_parameter_pack_p): Declare.
973 (template_parms_variadic_p): Declare.
974 (make_pack_expansion): Declare.
975 (check_for_bare_parameter_packs): Declare.
976 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
977 sizeof... expressions.
978 (pp_cxx_expression): Print pack expansions and non-type argument
980 (pp_cxx_exception_specification): Print pack expansions.
981 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
982 (pp_cxx_ctor_initializer): Print pack expansions.
983 (pp_cxx_type_id): Print pack expansions.
984 (pp_cxx_template_argument_list): Print argument packs.
985 (pp_cxx_template_parameter): Print ellipsis for template parameter
987 * pt.c (comp_template_parms): Compare template parameter packs.
988 (template_parameter_pack_p): New.
989 (template_parms_variadic_p): New.
990 (template_args_variadic_p): New.
991 (make_ith_pack_parameter_name): New.
992 (struct find_parameter_pack_data): New.
993 (find_parameter_packs_r): New.
994 (uses_parameter_packs): New.
995 (make_pack_expansion): New.
996 (check_for_bare_parameter_packs): New.
997 (expand_template_argument_pack): New.
998 (reduce_template_parm_level): Propagate parameter pack flag.
999 (process_template_parm): Add is_parameter_pack parameter to state
1000 when the parameter is actually a parameter pack. Create template
1001 parameter packs when is_parameter_pack is true.
1002 (current_template_args): The argument for a template parameter
1003 pack is an argument pack containing a single pack expansion.
1004 (process_partial_specialization): When checking that non-type
1005 argument expressions do not involve template parameters, loop over
1006 the arguments in argument packs separately.
1007 (push_template_decl_real): Check that the type of the declaration
1008 does not have any bare parameter packs. Check that primary
1009 templates have no more than one parameter pack, and that it comes
1010 at the end of the template parameter list.
1011 (convert_template_argument): Handle coercions for pack expansion
1012 expressions by coercing the pattern then rebuilding the expansion.
1013 (coerce_template_parms): When coercing the arguments for a
1014 variadic template, pack "extra" arguments into an argument pack.
1015 (coerce_template_template_parms): Cannot coerce between parameter
1016 packs and non-pack parameters.
1017 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1018 (comp_template_args): Expand all template arguments packs before
1019 comparing template argument lists.
1020 (mangle_class_name_for_template): Make argument packs as separate
1022 (for_each_template_parm_r): No need to handle BASELINK.
1023 (instantiate_class_template): Handle pack expansions in the base
1025 (tsubst_pack_expansion): New.
1026 (tsubst_template_args): Handle substitutions of argument packs and
1027 pack expansion into template argument lists.
1028 (tsubst_decl): Expand function parameter packs into separate
1029 function parameters.
1030 (tsubst_arg_types): Expand a type pack expansion into separate
1032 (tsubst_exception_specification): Handle pack expansions in
1033 exception specifiers.
1034 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1035 replacing a template parameter with its argument. If we encounter
1036 a substitution for an argument pack, just return the parameter
1038 (tsubst_copy): sizeof(X...) returns the number of elements in
1039 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1040 PARM_DECL is a parameter pack.
1041 (tsubst_expr): Expression pack expansions and argument packs
1042 cannot show up here; they will all be handled through function
1043 calls, sizeof, and template argument lists.
1044 (tsubst_copy_and_build): sizeof(X...) returns the number of
1045 elements in parameter pack X. Handle pack expansions in TREE_LIST
1046 and CONSTRUCTOR nodes.
1047 (fn_type_unification): Handle "incomplete" explicit template
1048 argument lists that specify some of the arguments for a template
1050 (type_unification_real): Unify arguments against pack expansions.
1051 (template_parm_level_and_index): New, helper function.
1052 (unify_pack_expansion): New.
1053 (unify): Unify argument packs on an argument-by-argument basis,
1054 handling variadic argument packs as well.
1055 (more_specialized_fn): Handle unification of function parameter
1056 packs. All things being equal, prefer non-variadic function
1057 templates to variadic function templates.
1058 (more_specialized_class): Prefer the variadic class template
1059 partial specialization that binds fewer arguments to a parameter
1061 (regenerate_decl_from_template): Expand function parameter packs
1062 into separate parameters.
1063 (instantiate_decl): Ditto.
1064 (tsubst_initializer_list): Handle pack expansions for base-class
1066 (dependent_type_p_r): Determine dependent types in argument packs
1067 and pack expansions.
1068 (value_dependent_expression_p): Determine value-dependence of
1069 non-type argument packs.
1070 (dependent_template_arg_p): Handle argument packs.
1071 * semantics.c (finish_cond): Check for bare parameter packs.
1072 (finish_expr_stmt): Ditto.
1073 (finish_for_expr): Ditto.
1074 (finish_switch_cond): Ditto.
1075 (finish_mem_initializers): Ditto.
1076 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1078 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1079 * parser.c (make_declarator): Declarator is not an expansion.
1080 (make_pointer_declarator): Transfer parameter pack flag to outer
1082 (make_reference_declarator): Ditto.
1083 (make_ptrmem_declarator): Ditto.
1084 (make_call_declarator): Ditto.
1085 (make_array_declarator): Ditto.
1086 (cp_parser_postfix_expression): Allow pack expansion expressions
1087 in the argument list for a call expression.
1088 (cp_parser_parenthesized_expression_list): Add new parameter
1089 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1090 into separate arguments."
1091 (cp_parser_new_placement): Allow pack expansion expressions.
1092 (cp_parser_new_initializer): Ditto.
1093 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1094 base-class initializer expansion.
1095 (cp_parser_mem_initializer): Ditto.
1096 (cp_parser_template_parameter_list): Keep track of whether the
1097 template parameter is a template parameter pack.
1098 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1099 template parameter pack.
1100 (cp_parser_type_parameter): Ditto.
1101 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1103 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1104 this declarator is a parameter pack.
1105 (cp_parser_parameter_declaration): The ellipsis does not end the
1106 parameter declaration, because it might be a parameter pack. Parse
1107 the ellipsis to indicate a parameter pack.
1108 (cp_parser_initializer): Allow pack expansions.
1109 (cp_parser_initializer_list): Allow ellipsis to create an
1110 initializer expansion.
1111 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1113 (cp_parser_type_id_list): Allow ellipsis to create an exception
1114 specifier expansion.
1115 (cp_parser_attribute_list): Don't allow pack expansions.
1116 (cp_parser_functional_cast): Allow pack expansions.
1117 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1118 compute the length of a parameter pack.
1119 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1120 end a template argument.
1121 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1122 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1125 2007-03-09 Dirk Mueller <dmueller@suse.de>
1127 * cp/call.c (build_new_op): Call warn_logical_operator.
1129 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1132 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1135 * pt.c (any_template_arguments_need_structural_equality_p):
1138 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1140 * decl.c (grokdeclarator): Disable warnings for anonymous
1143 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1145 * typeck2.c (readonly_error): Always emit a hard error.
1146 Remove last argument.
1147 * cp-tree.h (readonly_error): Adjust prototype.
1148 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1149 * typeck.c (build_unary_op): Likewise.
1150 (build_modify_expr): Likewise.
1152 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1155 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1157 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1160 * parser.c (struct cp_parser): New IN_IF_STMT.
1161 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1162 returning if parsing the body of an 'if' statement or issuing an
1163 error and continuing.
1164 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1166 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1168 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1171 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1174 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1176 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1177 Objective-C++. Don't exit early if -shared-libgcc needs to be
1180 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1182 * typeck.c (common_base_type): Delete unused function.
1184 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1186 * Make-lang.in: Add dummy lang.install-pdf target.
1188 2007-03-01 Simon Baldwin <simonb@google.com>
1191 * decl.c (check_tag_decl): Added new warning for typedef ignored
1192 when it precedes an otherwise valid non-typedef declaration.
1194 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1196 * typeck.c (build_function_call): Store converted arguments
1197 in a stack-allocated array instead of building a list.
1198 (convert_arguments): Store arguments in the array passed in as an
1199 argument, and return the actual number of arguments.
1200 * call.c (build_call): Delete, and replace with...
1201 (build_call_n, build_call_a): New.
1202 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1203 (build_over_call): Store converted arguments in a stack-allocated
1204 array instead of building a list.
1205 (build_cxx_call): Pass arguments in an array instead of as a list.
1206 (build_java_interface_fn_ref): Rewrite to avoid constructing
1208 * tree.h: Update declarations to reflect above changes.
1209 * method.c (use_thunk): Use a stack-allocated array to hold
1210 the arguments instead of a list.
1211 * rtti.c (throw_bad_cast): Update call to cxx_call.
1212 (throw_bad_typeid): Likewise.
1213 (build_dynamic_cast_1): Likewise.
1214 * init.c (build_builtin_delete_call): Use build_call_n.
1215 * decl.c (expand_static_init): Likewise.
1216 * except.c (cp_protect_cleanup_actions): Likewise.
1217 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1218 (gimplify_must_not_throw_expr): Likewise.
1219 (cxx_omp_apply_fn): Use build_call_a.
1221 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1223 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1224 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1226 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1228 * cp-tree.h (static_ctors): Remove.
1229 * cp-tree.h (static_dtors): Likewise.
1230 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1231 refactoring of tree_map hierarchy.
1232 (decl_shadowed_for_var_insert): Likewise.
1233 * semantics.c (expand_body): Use c_expand_body.
1234 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1235 * decl2.c (static_ctors): Remove.
1236 (static_dtors): Likewise.
1237 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1238 objc_generate_static_init_call. Do not call static_[cd]tors.
1239 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1241 (cp_write_global_declarations): Likewise.
1243 2007-02-23 Richard Guenther <rguenther@suse.de>
1245 * class.c (note_name_declared_in_class): Make declaration
1246 changes meaning a pedwarn.
1248 2007-02-22 Michael Matz <matz@suse.de>
1251 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1252 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1253 dump_function_decl): Guard emitting outer scopes by new flag.
1254 * cp-lang.c (cxx_dwarf_name): New function.
1255 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1256 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1258 (push_template_decl_real, lookup_template_class): Remove calls
1261 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1263 * call.c (build_new_method_call): Ensure that explicit calls of
1264 destructors have type "void".
1266 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1268 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1269 and -Walways-true with -Waddress.
1270 * cvt.c (convert_to_void): Replace unconditional warning with
1273 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1275 * decl.c, tree.c: Fix comment typos.
1277 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1280 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1281 statement expression if we had an error mark node.
1283 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1284 Brooks Moses <brooks.moses@codesourcery.com>
1285 Lee Millward <lee.millward@codesourcery.com>
1287 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1288 Change class to tcc_vl_exp.
1290 * call.c (build_call): Use build_call_list instead
1292 (build_over_call): Likewise.
1293 (build_new_method_call): Use build_min_non_dep_call_list
1294 instead of build_min_non_dep.
1296 * error.c (dump_call_expr_args): New function.
1297 (dump_aggr_init_expr_args): New function.
1298 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1299 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1301 * cvt.c (convert_to_void): Use build_call_array instead
1302 of build3; use new AGGR_INIT_EXPR accessor macros.
1304 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1305 instead of TREE_CODE_LENGTH.
1307 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1308 AGGR_INIT_EXPR accessor macros.
1310 * cp-gimplify.c (cp_gimplify_init_expr): Use
1311 AGGR_INIT_EXPR_SLOT to set the slot operand.
1313 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1314 (AGGR_INIT_EXPR_SLOT): New macro.
1315 (AGGR_INIT_EXPR_ARG): New macro.
1316 (aggr_init_expr_nargs): New macro.
1317 (AGGR_INIT_EXPR_ARGP): New macro.
1318 (aggr_init_expr_arg_iterator): New.
1319 (init_aggr_init_expr_arg_iterator): New.
1320 (next_aggr_init_expr_arg): New.
1321 (first_aggr_init_expr_arg): New.
1322 (more_aggr_init_expr_args_p): New.
1323 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1324 (stabilize_aggr_init): New declaration.
1325 (build_min_non_dep_call_list): Likewise.
1327 * tree.c (process_aggr_init_operands): New function.
1328 (build_aggr_init_array) New function.
1329 (build_cplus_new): Update to use new CALL_EXPR and
1330 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1331 build_aggr_init_array.
1332 (build_min_non_dep_call_list) New function.
1333 (build_min_nt): Assert input code parameter is not a variable
1334 length expression class.
1335 (build_min, build_min_non_dep): Likewise.
1336 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1337 to check for equality instead of recursing. Handle tcc_vl_exp
1339 (stabilize_call): Update to only handle CALL_EXPRs, not
1340 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1341 (stabilize_aggr_init): New function.
1342 (stabilize_init): Use it.
1344 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1345 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1346 AGGR_INIT_EXPR accessor macros and argument iterators.
1348 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1349 build_vl_exp. Iterate through the operands, recursively
1350 processing each one.
1351 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1352 CALL_EXPR accessor macros.
1353 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1354 tree code classes. Use TREE_OPERAND_LENGTH instead of
1357 * semantics.c (finish_call_expr): Use build_nt_call_list
1358 instead of build_nt.
1359 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1360 accessor macros. Use build_call_array to construct the
1361 CALL_EXPR node instead of build3
1363 * decl2.c (build_offset_ref_call_from_tree): Use
1364 build_nt_call_list and build_min_non_dep_call_list instead
1365 of build_min_nt and build_min_non_dep.
1367 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1368 Use build_nt_call_list instead of build_min_nt.
1370 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1373 * call.c (build_conditional_expr): Improve error message.
1375 2007-02-13 Dirk Mueller <dmueller@suse.de>
1377 * friend.c (do_friend): Annotate warning about friend
1378 declarations in templates with OPT_Wnon_template_friend.
1379 Convert informal message from warning() to inform().
1381 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1382 Mark Mitchell <mark@codesourcery.com>
1385 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1386 instantiations for variables.
1388 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1391 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1392 Check warn_unused_value just once.
1394 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1397 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1398 (fn_type_unificiation): Likewise.
1399 (get_bindings): Likewise.
1401 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1404 * decl.c (finish_function): Use DECL_REPLACEABLE.
1405 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1407 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1409 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1411 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1413 * decl.c (grokvardecl): Don't error if !have_tls.
1414 (grokdeclarator): Likewise.
1415 * parser.c (cp_parser_omp_threadprivate): Likewise.
1417 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1420 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1421 parameters and result decls in omp clauses.
1422 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1425 2007-02-05 Dirk Mueller <dmueller@suse.de>
1428 * parser.c (cp_parser_class_specifier): Always initialize bases.
1430 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1432 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1433 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1434 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1436 * semantics.c (finish_omp_atomic): Store a whole expression node
1437 in operand 1, and integer_zero_node in operand 0, for dependent
1438 OMP_ATOMIC. Rewrite to make flow easier to understand.
1440 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1442 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1444 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1446 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1447 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1449 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1451 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1452 keyword warning to -Wc++0x-compat.
1454 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1456 * decl.c (grokdeclarator): Update documentation.
1458 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1461 * decl.c (grokdeclarator): If __thread is used together with
1462 a storage class other than extern and static, clear thread_p
1463 after issuing diagnostics and fall through to checking the
1466 2007-01-30 Roger Sayle <roger@eyesopen.com>
1468 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1469 calculating the size of an array (to avoid recursive errors).
1471 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1474 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1476 * call.c (convert_like_real): Don't warn when converting to
1479 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1481 * decl.c (pop_label): Replace warning with call to
1482 warn_for_unused_label.
1484 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1487 * semantics.c (finish_pseudo_destructor_expr): Check the
1488 destrutor name by calling check_dtor_name.
1490 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1492 * lex.c (D_CPP0X): Rename.
1494 (reswords): D_CPP0X -> D_CXX0X.
1495 (init_reswords): Ditto.
1496 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1497 of C++0x keywords as identifiers.
1499 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1502 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1505 2007-01-23 Ian Lance Taylor <iant@google.com>
1507 * typeck.c (convert_for_assignment): Only warn about a = b = c
1508 when converting to bool.
1510 2007-01-23 Roger Sayle <roger@eyesopen.com>
1512 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1514 * typeck.c (ignore_overflows): Remove the remaining uses of
1515 TREE_CONSTANT_OVERFLOW.
1517 2007-01-20 Jan Hubicka <jh@suse.cz>
1519 * decl2.c (start_objects, start_static_storage_duration_function):
1520 Do not make the functions uninlinable.
1522 2007-01-17 Ian Lance Taylor <iant@google.com>
1524 * class.c (add_method): Call VEC_reserve_exact rather than passing
1525 a negative size to VEC_reserve.
1527 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1530 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1532 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1535 * decl.c (make_typename_type): If the qualified name is not a
1536 type, issue an error.
1537 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1540 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1542 * rtti.c: Include target.h.
1543 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1544 don't emit typeinfo for fundamental types as weak.
1545 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1547 2007-01-08 Richard Guenther <rguenther@suse.de>
1549 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1551 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1553 * call.c (standard_conversion): Pass flag to
1554 vector_types_convertible_p to disallow emission of note.
1555 * typeck.c (convert_for_assignment): Pass flag to
1556 vector_types_convertible_p to allow emission of note.
1557 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1558 to disallow emission of note.
1560 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1563 * typeck.c (build_binary_op): Call overflow_warning if
1564 TREE_OVERFLOW_P is true for the result and not for any of the
1567 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1570 * class.c (add_method): Don't wait until template
1571 instantiation time to complain about duplicate methods.
1573 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1576 * semantics.c (finish_unary_op_expr): Warn only if result
1577 overflowed and operands did not.
1579 2007-01-05 Ian Lance Taylor <iant@google.com>
1581 * typeck.c (build_binary_op): Warn about comparing a non-weak
1584 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1586 * pt.c (tsubst): Propagate the need for structural equality checks
1587 when reducing the level of template parameters.
1589 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1591 * pt.c: Fix a comment typo.
1593 2007-01-02 Ian Lance Taylor <iant@google.com>
1595 * semantics.c (maybe_convert_cond): Optionally warn when using an
1596 assignment as a condition.
1597 * typeck.c (convert_for_assignment): Optionally warn about
1598 assigning the result of an assignment to a bool.
1600 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1602 * pt.c (canonical_template_parms): Correct typo in comment.
1604 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1606 * typeck.c (structural_comptypes): Renamed from "comptypes".
1607 (comptypes): Use canonical type information to perform fast type
1608 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1609 canonical type comparison returns the same results as we would see
1610 from the current, structural check. Support COMPARE_STRUCTURAL
1611 when we need structural checks.
1612 * decl.c (typename_compare): Fix comment.
1613 (build_typename_type): TYPENAME_TYPE nodes require structural
1614 equality checks, because they resolve different based on the
1616 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1617 require structural equality checks (for now).
1618 (build_ptrmemfunc_type): Build the canonical pointer to member
1620 (compute_array_index_type): Whenever we build a new index type
1621 to represent the size of an array in a template, we need to mark
1622 this index type as requiring structural equality. This goes for
1623 arrays with value-dependent sizes with the current ABI, or all
1625 * tree.c (cplus_array_hash): New.
1626 (struct cplus_array_info): New.
1627 (cplus_array_compare): New.
1628 (cplus_array_htab): New.
1629 (build_cplus_array_type_1): Use a hash table to cache the array
1630 types we build. Build the canonical array type for each array
1632 (cp_build_qualified_type_real): When building a cv-qualified array
1633 type, use the hash table of array types and build canonical array
1635 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1636 use structural equality (for now).
1637 * cp-tree.h (COMPARE_STRUCTURAL): New.
1638 * pt.c (canonical_template_parms): New.
1639 (canonical_type_parameter): New.
1640 (process_template_parm): Find the canonical type parameter.
1641 (lookup_template_class): When we have named the primary template
1642 type, set the canonical type for our template class to the primary
1643 template type. If any of the template arguments need structural
1644 equality checks, the template class needs structural equality
1646 (tsubst): When reducing the level of a template template
1647 parameter, we require structural equality tests for the resulting
1648 parameter because its template parameters have not had their types
1649 canonicalized. When reducing a template type parameter, find the
1650 canonical reduced type parameter.
1651 (any_template_arguments_need_structural_equality_p): New.