1 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
2 Mark Mitchell <mark@codesourcery.com>
5 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
6 hidden due to friend declarations in local classes.
8 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
10 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
11 * cp-tree.def (DECLTYPE_TYPE): New.
12 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
13 (dump_type_prefix): Ditto.
14 (dump_type_suffix): Ditto.
15 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
16 * mangle.c (write_type): Handle DECLTYPE_TYPE.
17 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
19 (DECLTYPE_TYPE_EXPR): New.
20 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
21 (finish_declared_type): Declare.
22 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
24 (pp_cxx_type_id): Ditto.
25 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
26 (tsubst): Substitute into a DECLTYPE_TYPE node.
28 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
30 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
31 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
32 structural equality (because we can't hash the expressions).
33 (finish_declared_type): New.
34 * lex.c (reswords): Add "decltype" keyword.
35 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
36 (cp_parser_postfix_expression): Add member_access_only_p to
37 restrict postfix expression to member access expressions.
38 (cp_parser_unary_expression): Update call to
39 cp_parser_postfix_expression to reflect new parameter.
40 (cp_parser_declared_type): New.
41 (cp_parser_simple_type_specifier): Parse decltype types.
43 2007-07-27 Mark Mitchell <mark@codesourcery.com>
46 * call.c (convert_for_arg_passing): Only widen bitfields to their
47 declared types if necessary.
49 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
51 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
54 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
56 * decl.c (typename_hash, typename_compare): Constify.
57 * mangle.c (hash_type, compare_type): Likewise.
58 * pt.c (eq_local_specializations, hash_local_specialization):
60 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
62 * typeck2.c (pat_compare): Likewise.
64 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
66 * method.c (implicitly_declare_fn): Increase alignment if member
67 function pointer format requires it.
69 2007-07-24 Paolo Carlini <pcarlini@suse.de>
72 * typeck.c (check_return_expr): Do not pass a null argument
75 2007-07-24 Paolo Carlini <pcarlini@suse.de>
78 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
81 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
84 * typeck.c (convert_arguments): Only use default args if we have
88 * typeck.c (structural_comptypes): No need to check
89 resolve_typename_type return value here.
90 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
91 * pt.c (resolve_typename_type): Follow typename typedefs. Return
92 original type rather than error_mark_node in case of failure.
93 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
94 resolve_typename_type result check.
95 (cp_parser_direct_declarator, cp_parser_head,
96 cp_parser_constructor_declarator_p): Likewise.
98 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
100 * pt.c (template_parms_variadic_p): Remove.
101 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
103 2007-07-12 Jakub Jelinek <jakub@redhat.com>
106 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
107 argument to dump_aggr_init_expr_args instead of false.
109 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
111 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
112 canonical types; otherwise, fall back to structural type
113 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
114 internal compiler error if the canonical types are wrong.
116 2007-07-11 Paolo Carlini <pcarlini@suse.de>
119 * parser.c (cp_parser_make_indirect_declarator): When the
120 the code argument is ERROR_MARK return cp_error_declarator.
122 2007-07-09 Geoffrey Keating <geoffk@apple.com>
125 * decl.c (cxx_init_decl_processing): Don't set
126 force_align_functions_log.
127 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
128 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
129 FUNCTION_DECL, return its alignment.
131 2007-07-09 Richard Guenther <rguenther@suse.de>
133 * decl.c (start_preparsed_function): Do not promote return type.
135 2007-07-08 Paolo Carlini <pcarlini@suse.de>
138 * pt.c (unify): Never pass error_mark_node to template_decl_level.
140 2007-07-07 Mark Mitchell <mark@codesourcery.com>
143 * pt.c (resolve_overloaded_unification): Robustify. Return a
145 (type_unification_real): Adjust accordingly.
147 2007-07-06 Richard Guenther <rguenther@suse.de>
149 * init.c (build_new_1): Use the correct pointer type.
150 * typeck2.c (build_m_component_ref): Likewise.
152 2007-07-05 Mark Mitchell <mark@codesourcery.com>
155 * init.c (build_zero_init): Always build an initializer for
157 * typeck2.c (build_functional_cast): Use build_zero_init.
160 * init.c (build_new_1): Always pass the allocation function to
161 build_op_delete_call.
162 * call.c (build_op_delete_call): Handle operator delete with a
163 variable-argument list. Do not issue an error when no matching
164 deallocation function is available for a new operator.
167 * cp-tree.h (any_value_dependent_elements_p): Declare it.
168 * decl.c (value_dependent_init_p): New function.
169 (cp_finish_decl): Use it.
170 * pt.c (value_dependent_expression_p): Use
171 any_value_dependent_elements_p.
172 * parser.c (cp_parser_primary_expression): Add comment about
173 treating dependent qualified names as integral
174 constant-expressions.
176 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
178 * decl.c (build_ptrmemfunc_type): Always use structural equality
179 tests when comparing pointer-to-member-function types, because the
180 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
183 2007-07-03 Mark Mitchell <mark@codesourcery.com>
185 * init.c (build_new): Tweak comment.
187 2007-06-29 Dave Brolley <brolley@redhat.com>
190 * parser.c (cp_parser_new_type_id): Don't reduce a named array
191 type to its base type and number of elements here.
192 * init.c (build_new): Call complete_type_or_else to ensure that the
193 type is complete and to issue a diagnostic if it is not.
194 (build_new_1): Don't call complete_type_or_else here.
196 2007-07-03 Richard Guenther <rguenther@suse.de>
199 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
202 2007-07-02 Simon Baldwin <simonb@google.com>
204 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
205 for inner-style nested forward declarations that don't declare
208 2007-07-02 Jakub Jelinek <jakub@redhat.com>
211 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
212 DECL_P in not a variable and appears more than once error messages.
214 2007-07-01 Ollie Wild <aaw@google.com>
216 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
217 (select_decl): Remove function.
218 (unqualified_namespace_lookup): Populate binding by calling
219 ambiguous_decl. Remove select_decl call.
220 (lookup_qualified_name): Remove select_decl call.
221 * decl.c (lookup_and_check_tag): Check for ambiguous references.
222 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
223 generation when name lookup is ambiguous.
225 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
228 * init.c (build_new_1): Use structural equality on the copy of the
231 2007-06-28 Geoffrey Keating <geoffk@apple.com>
233 * decl2.c (determine_visibility): Implement
234 flag_visibility_ms_compat effect on type info.
235 * decl.c (cxx_init_decl_processing): Implement
236 global effect of flag_visibility_ms_compat.
238 2007-06-28 Geoffrey Keating <geoffk@apple.com>
240 * decl2.c (start_objects): Mark constructor-running function
243 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
246 * decl.c (grokdeclarator): Reset friendp for member functions declared
247 friend of their own class.
249 2007-06-23 Mark Mitchell <mark@codesourcery.com>
251 * decl2.c (determine_visibility): Don't look for dllexport here.
252 (determine_visibility_from_class): Tidy.
254 2007-06-18 Simon Baldwin <simonb@google.com>
257 * parser.c (cp_parser_single_declaration): Added check for storage
258 class other than sc_none in parsed declaration, and a flag to indicate
259 if the call is part of an explicit template specialization parse.
260 * (cp_parser_explicit_specialization): Specialization check flag added
261 to call to cp_parser_single_declaration(), set true.
262 * (cp_parser_template_declaration_after_export): Specialization check
263 flag added to call to cp_parser_single_declaration(), set false.
264 * pt.c (check_explicit_specialization): Added code to copy visiblity
265 and linkage from the templated function to the explicit specialization.
267 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
269 * typeck.c (build_binary_op): For templates build the
270 expression in pieces to avoid the assert in build2_stat.
271 (get_member_function_from_ptrfunc):
272 Change over to using POINTER_PLUS_EXPR and convert
273 the second operand to sizetype.
274 * typeck2.c (build_m_component_ref): Likewise.
275 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
276 instead of PLUS_EXPR for pointers.
277 (build_new_1): Likewise.
278 (build_vec_delete_1): Likewise.
279 (build_vec_delete): Likewise.
280 * class.c (build_base_path): Likewise.
281 (build_base_path): Likewise.
282 (convert_to_base_statically): Likewise.
283 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
284 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
285 instead of PLUS_EXPR.
286 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
287 instead of PLUS_EXPR for pointers.
288 * call.c (build_special_member_call): Likewise.
289 * rtti.c (build_headof): Likewise.
290 Use sizetype instead of ptrdiff_type_node.
291 (tinfo_base_init): Create a POINTER_PLUS_EXPR
292 instead of PLUS_EXPR for pointers.
293 * except.c (expand_start_catch_block): Do a
294 NEGATIVE and then a POINTER_PLUS_EXPR instead
296 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
297 PLUS_EXPR on pointer types over to use
298 POINTER_PLUS_EXPR and remove the conversion
299 to the pointer types.
300 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
301 adding to a pointer type. Use size_int instead of
302 ssize_int. Convert the index to sizetype before
303 adding it to the pointer.
305 2007-06-15 Mark Mitchell <mark@codesourcery.com>
307 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
308 (DECL_ANON_UNION_VAR_P): New macro.
309 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
310 than DECL_VAR_MARKED_P, to keep track of which variables we have
312 * decl.c (redeclaration_error_message): Complain about redeclaring
313 anonymous union members at namespace scope.
314 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
316 2007-06-14 Geoff Keating <geoffk@apple.com>
318 * decl2.c (determine_visibility): Ensure that functions with
319 hidden types as parameters are hidden.
322 * decl2.c (determine_visibility): Remove duplicate code for
325 2007-06-12 Ian Lance Taylor <iant@google.com>
328 * init.c (avoid_placement_new_aliasing): New static function.
329 (build_new_1): Call it.
331 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
333 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
334 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
336 2007-06-08 Jakub Jelinek <jakub@redhat.com>
339 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
340 on init, the non-decl cond operand and increment value.
342 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
345 * decl.c (check_initializer): Report an error when a brace enclosed
346 initializer is used for a non-aggregate type in C++98.
347 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
349 (grokdeclarator): Likewise.
350 (move_fn_p): Likewise.
351 * typeck.c (check_return_expr): Likewise.
352 * call.c (reference_binding): Likewise.
353 * error.c (cp_cpp_error): Likewise.
354 * pt.c (check_default_tmpl_args): Likewise.
356 * lex.c (init_reswords): Likewise.
357 * parser.c (p_parser_primary_expression): Likewise.
358 (TOKEN_PRECEDENCE): Likewise.
359 (cp_parser_init_declarator): Likewise.
360 (cp_parser_ptr_operator): Likewise.
361 (cp_parser_parameter_declaration): Likewise.
362 (cp_parser_enclosed_template_argument_list): Likewise.
363 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
364 (cp_parser_next_token_ends_template_argument_p): Likewise.
366 2007-06-04 Simon Baldwin <simonb@google.com>
368 * decl.c (grokdeclarator): Readability change. Moved case labels
369 into direct switch statement scope.
371 2007-06-04 Paolo Carlini <pcarlini@suse.de>
373 * call.c (convert_like_real): Remove pointless code.
375 2007-05-31 Mark Mitchell <mark@codesourcery.com>
377 * decl.c (get_atexit_fn_ptr_type): New function.
378 (get_atexit_node): Use it.
379 (start_cleanup_fn): Likewise.
380 (register_dtor_fn): Use the object's destructor, instead of a
381 separate cleanup function, where possible.
382 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
383 (atexit_fn_ptr_type_node): New macro.
384 * decl2.c (build_cleanup): Use build_address.
386 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
388 * typeck.c (build_binary_op): Include types in error.
390 2007-05-31 Jakub Jelinek <jakub@redhat.com>
393 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
394 needs runtime initialization.
396 2007-05-31 Paolo Carlini <pcarlini@suse.de>
399 * semantics.c (finish_trait_expr): Complete the types.
401 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
402 Douglas Gregor <doug.gregor@gmail.com>
403 Pedro Lamarao <pedro.lamarao@mndfck.org>
404 Howard Hinnant <howard.hinnant@gmail.com>
408 * typeck.c (comptypes): Don't consider rvalue and lvalue
409 reference types to be equivalent.
410 (check_return_expr): Move from certain lvalues when returning
412 * decl.c (grokdeclarator): Implement reference collapsing.
413 (copy_fn_p): Don't consider constructors taking rvalue references
414 to be copy constructors.
416 * call.c (conversion): New "rvaluedness_matches_p" member.
417 (convert_class_to_reference): Require reference type as first
418 parameter instead of base type.
419 (reference_binding): Add logic to handle rvalue references.
420 (implicit_conversion): Update inaccurate comment.
421 (convert_like_real): Disable creation of temporaries that are
422 impossible to initialize for types with move constructors.
423 (build_over_call): Elide move constructors when possible.
424 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
425 (maybe_handle_ref_bind): Return conversion instead of type node.
426 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
427 determine preferred conversion sequences.
428 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
429 (LOOKUP_PREFER_RVALUE): New.
430 (DECL_MOVE_CONSTRUCTOR_P): New.
431 (struct cp_declarator): Add "reference" member for reference
432 types, with new "rvalue_ref" flag.
433 (cp_build_reference_type): Declare.
434 (move_fn_p): Declare.
435 * error.c (dump_type_prefix): Format rvalue reference types
436 correctly in error messages.
437 * except.c (build_throw): Move from certain lvalues when
439 * mangle.c (write_type): Mangle rvalue references differently
440 than regular references.
441 * parser.c (make_reference_declarator): Add boolean parameter for
443 (cp_parser_make_indirect_declarator): New.
444 (cp_parser_new_declarator_opt): Call
445 cp_parser_make_indirect_declarator.
446 (cp_parser_conversion_declarator_opt): Ditto.
447 (cp_parser_declarator): Ditto.
448 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
450 * pt.c (tsubst): Implement reference collapsing.
451 (maybe_adjust_types_for_deduction): Implement special template
452 parameter deduction rule for rvalue references.
453 (type_unification_real): Update calls to
454 maybe_adjust_types_for_deduction.
455 (try_one_overload): Ditto.
456 (unify_pack_expansion): Ditto.
457 * tree.c (lvalue_p_1): Handle rvalue reference types.
458 (cp_build_reference_type): New.
460 2007-05-30 Jakub Jelinek <jakub@redhat.com>
463 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
464 variables that need runtime initialization.
466 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
469 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
470 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
471 case POSTDECREMENT_EXPR>): Return the error_mark_node
472 if either the real or imaginary parts would an
475 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
476 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
479 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
480 token is a closing brace, false if there are no tokens left.
481 (cp_parser_namespace_alias_definition): Only consume the next token if
482 it is a closing brace.
484 * parser.c (cp_parser_class_specifier): Likewise.
486 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
488 * semantics.c (finish_member_declaration): Fix a typo in the
491 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
503 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
504 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
505 * pt.c (check_for_bare_parameter_packs): Return bool indicated
506 whether everything was okay. Fix indentation.
507 (push_template_decl_real): Check for bare parameter packs in
508 function parameters; where errors occur, mark the parameter types
509 with ERROR_MARK_NODEs to avert ICEs.
510 (coerce_template_parameter_pack): New.
511 (coerce_template_parms): Moved parameter pack coercion into
512 coerce_template_parameter_pack, and permit it anywhere in the
513 template parameter list (not just at the end). Parameter and
514 argument indices can vary (somewhat) separately now, so add
515 PARM_IDX and ARG_IDX.
516 (fn_type_unification): Don't set an argument pack as incomplete if
517 no argument pack was deduced.
518 (type_unification_real): If a type parameter is a parameter pack
519 and has not otherwise been deduced, it will be deduced to an empty
521 (more_specialized_fn): Use the actual lengths of the argument
522 lists when comparing against expansions.
523 * semantics.c (finish_member_declaration): If a field's type has
524 bare parameter packs, error and set its type to ERROR_MARK_NODE.
526 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
529 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
531 2007-05-22 Ollie Wild <aaw@google.com>
533 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
534 (unqualified_namespace_lookup): Adds check for hidden types.
536 2007-05-22 Ollie Wild <aaw@google.com>
538 * decl.c (duplicate_decls): Verify namespace names are unique.
540 2007-05-21 Mark Mitchell <mark@codesourcery.com>
542 * decl.c (cxx_maybe_build_cleanup): Handle
543 __attribute__((cleanup)).
545 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
547 * cvt.c (cp_convert_and_check): Don't check warnings if the
550 2007-05-18 Geoffrey Keating <geoffk@apple.com>
552 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
554 2007-05-14 Paolo Carlini <pcarlini@suse.de>
557 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
558 type only if is a class type (5.2.8/4).
560 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
562 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
563 * decl.c (grokdeclarator): Use unsigned_type_for instead of
564 c_common_unsigned_type.
566 2007-05-11 Silvius Rus <rus@google.com>
568 * cp/typeck.c (build_indirect_ref): Add call to
569 strict_aliasing_warning.
570 (build_reinterpret_cast_1): Condition call to
571 strict_aliasing_warning.
573 2007-05-11 Jan Hubicka <jh@suse.cz>
575 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
576 * decl2.c (start_objects): ctors and dtors are no longer public.
577 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
579 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
581 * typeck.c (build_unary_op): Remove code that used to
582 handle non lvalue increments/decrements.
584 2007-05-07 Mike Stump <mrs@apple.com>
586 * parser.c (check_empty_body): Add.
587 (cp_parser_iteration_statement): Add call to check_empty_body.
589 2007-05-05 Geoffrey Keating <geoffk@apple.com>
592 * mangle.c (write_mangled_name): Mangle static variable names.
593 (write_unqualified_name): Use local-source-name for
594 namespace-scope static variables.
596 2007-05-04 Dirk Mueller <dmueller@suse.de>
598 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
601 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
604 * decl2.c (constrain_class_visibility):
605 Use strip_pointer_or_array_types instead of strip_array_types.
607 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
610 * decl.c (reshape_init_r): Don't reshape the first element if it
611 is a pointer to member function.
613 2007-04-27 Simon Baldwin <simonb@google.com>
615 * decl.c (grokparms): Changed message format from %qD to %qE.
617 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
619 * error.c (maybe_warn_variadic_templates): Variadic templates are
620 now in C++0x, so only warn about them in C++98 mode.
622 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
625 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
626 integeral types from vectors types.
628 2007-04-26 Jakub Jelinek <jakub@redhat.com>
631 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
632 for type dependent OMP_CLAUSE_DECLs.
634 2007-04-24 Mark Mitchell <mark@codesourcery.com>
637 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
638 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
639 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
640 * init.c (build_zero_init): Adjust, as
641 COMPLEX_TYPE is now a SCALAR_TYPE.
642 * typeck2.c (digest_init): Allow brace-enclosed initializers for
643 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
645 2007-04-25 Paolo Carlini <pcarlini@suse.de>
647 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
648 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
649 (trait_expr_value): Adjust.
651 2007-04-23 Simon Baldwin <simonb@google.com>
653 * decl.c (grokparms): Added new error for duplicate function
654 parameters names in function prototypes, to match gcc behavior.
656 2007-04-23 Jan Hubicka <jh@suse.cz>
658 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
661 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
663 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
664 instead of checking GIMPLE_STMT_P in chain_next.
666 2007-04-17 Mark Mitchell <mark@codesourcery.com>
669 * call.c (convert_for_arg_passing): Convert bitfields to their
672 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
675 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
677 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
681 * cp/decl2.c (constrain_class_visibility):
682 Do not warn about the use of anonymous namespace in the main input file.
684 2007-04-15 Mark Mitchell <mark@codesourcery.com>
686 * cp-tree.h (current_template_parms): Fix typo in comment.
688 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
690 * cp-tree.h, error.c: Fix comment typos.
692 2007-04-13 Jason Merrill <jason@redhat.com>
695 * call.c (reference_binding): Add c_cast_p parm. If true,
696 add quals to TO as needed to make it reference-compatible.
698 2007-04-11 Jan Hubicka <jh@suse.cz>
700 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
701 that we are not processing template_decl.
703 2007-04-09 Mark Mitchell <mark@codesourcery.com>
706 * class.c (build_base_path): Ensure that the converted pointer has
707 the same cv-qualification as the input.
709 2007-04-09 Paolo Carlini <pcarlini@suse.de>
711 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
713 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
715 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
717 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
718 * tree.c (cp_add_pending_fn_decls): Remove.
719 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
721 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
723 Revert change removing staticp.
725 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
727 * cp-objcp-common.c (cxx_staticp): Remove.
728 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
729 * cp-tree.h (cxx_staticp):
731 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
733 * class.c (check_for_override): Don't remove dllmport attribute
736 2007-04-03 Jakub Jelinek <jakub@redhat.com>
739 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
740 type issue error and return early.
742 2007-03-30 Jason Merrill <jason@redhat.com>
745 * typeck.c (cp_type_readonly): New fn.
746 * cp-tree.h: Declare it.
747 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
748 (cp_finish_decl): Not here.
750 2007-03-31 Richard Guenther <rguenther@suse.de>
752 * optimize.c (maybe_clone_body): Replace splay-tree usage by
755 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
760 * parser.c (declarator_can_be_parameter_pack): New.
761 (cp_parser_template_parameter): Only parse the `...' if the
762 declarator can be a parameter pack.
763 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
765 * pt.c (find_parameter_packs_r): Look into the bounds on integer
766 types (they could be used as array bounds).
767 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
768 (tsubst_pack_expansion): Handle failure to expand parameter
771 2007-03-30 Paolo Carlini <pcarlini@suse.de>
774 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
775 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
776 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
777 (CLASS_TYPE_NON_UNION_P): Add.
778 (struct lang_type_class): Add has_complex_dflt.
779 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
780 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
781 * cp-tree.def: Add TRAIT_EXPR.
782 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
783 * lex.c (struct resword): Add __has_nothrow_assign,
784 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
785 __has_trivial_constructor, __has_trivial_copy,
786 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
787 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
788 __is_pod, __is_polymorphic, __is_union.
789 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
790 (cp_parser_trait_expr): New.
791 * semantics.c (finish_trait_expr, trait_expr_value
792 classtype_has_nothrow_copy_or_assign_p): New.
793 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
795 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
796 * class.c (check_bases, check_field_decl, check_bases_and_members):
797 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
798 * pt.c (uses_template_parms, tsubst_copy_and_build,
799 value_dependent_expression_p, type_dependent_expression_p): Deal with
801 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
803 2007-03-29 Richard Guenther <rguenther@suse.de>
805 * tree.c (cp_walk_subtrees): Do not set input_location.
807 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
810 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
813 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
815 * parser.c (struct cp_parser): Update comment for
816 greater_than_is_operator_p.
817 (cp_parser_primary_expression): In C++0x mode, a cast operator can
818 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
819 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
820 !GREATER_THAN_IS_OPERATOR_P.
821 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
822 `>>' operators that will become two `>' tokens in C++0x.
823 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
824 mode, allowing it to terminate default arguments.
825 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
826 `>>' like two consecutive `>' tokens.
827 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
828 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
829 ends a template argument.
831 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
833 * decl.c (redeclaration_error_message): Complain when redeclaring
834 a friend function with default template arguments (C++0x mode only).
835 * cp-tree.h (check_default_tmpl_args): Declare.
836 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
837 template arguments in function templates. Add support for checking
838 the default template arguments of friend templates.
839 (push_template_decl_real): Fix call to check_default_tmpl_args.
840 (type_unification_real): If a template parameter has not been
841 deduced but provides a default template argument, substitute into
842 that default template argument.
843 * parser.c (cp_parser_init_declarator): When declaring (but not
844 defining!) a function template in C++0x mode, check for default
847 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
850 * decl.c (grokdeclarator): Deal with cv-qualified function type
851 typedefs in the same way for member and non-member functions.
853 2007-03-26 Dirk Mueller <dmueller@suse.de>
855 * parser.c (cp_parser_member_declaration): Pedwarn
856 about stray semicolons after member declarations.
858 2007-03-26 Paolo Carlini <pcarlini@suse.de>
861 * pt.c (instantiate_decl): Set in_system_header.
863 2007-03-22 Mark Mitchell <mark@codesourcery.com>
865 * cp-tree.h (current_tempalte_parms): Improve documentation.
866 * pt.c (current_template_args): Likewise.
869 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
870 not consume tokens when failing.
872 2007-03-22 Jim Wilson <wilson@specifix.com>
873 Mark Mitchell <mark@codesourcery.com>
876 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
877 consistent with FROM.
879 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
881 * error.c (dump_expr): Handle dependent names that designate types.
882 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
884 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
886 * cp-tree.def, parser.c, pt.c: Fix comment typos.
888 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
890 * cvt.c (cp_convert_and_check) : Define.
891 * cp-tree.h (cp_convert_and_check): Declare.
892 * call.c (convert_conversion_warnings): Rename to
893 conversion_null_warnings. The warning for floating-point to
894 integer is handled by convert_and_check in convert_like_real.
895 (convert_like_real): convert_conversion_warnings was renamed as
896 conversion_null_warnings.
897 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
898 overflow and changes of value during conversion.
900 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
903 * parser.c (cp_parser_statement): If 'namespace' is found, this
904 only can be a namespace alias definition, so parse it now.
905 (cp_parser_namespace_alias_definition): if we find an open brace
906 instead of '=', then this is actually a misplaced namespace
909 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
912 * decl.c (cxx_init_decl_processing): Move command-line options
913 processing to c-opts.c.
915 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
917 * ptree.c (cxx_print_type): Use formatting markup for integers
918 when printing template parameter index/level/orig level.
919 (cxx_print_xnode): Ditto.
920 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
921 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
922 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
924 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
925 rather than a HOST_WIDE_INT.
926 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
927 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
929 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
930 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
931 IN_BASE_INITIALIZER bool bitfields.
932 (struct cp_declarator): Make KIND a 4-bit field. Make
933 PARAMETER_PACK_P a bool bitfield just after KIND.
934 * pt.c (uses_parameter_packs): Destroy the pointer set.
935 (make_pack_expansion): Ditto.
936 (check_for_bare_parameter_packs): Ditto.
937 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
939 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
942 * call.c (convert_default_arg): Instead of copying the node,
945 2007-03-15 Dirk Mueller <dmueller@suse.de>
948 * call.c (convert_conversion_warnings): New..
949 (convert_like_real): .. factored out from here.
950 (convert_conversion_warnings): Add warning about
951 false being converted to NULL in argument passing.
953 2007-03-14 Dirk Mueller <dmueller@suse.de>
955 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
956 (finish_do_body): Warn about empty body in do/while statement.
958 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
960 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
962 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
965 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
968 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
970 * cp/repo.c (init_repo): Initialize random_seed saved options.
971 (finish_repo): Adjust.
973 2007-03-13 Mark Mitchell <mark@codesourcery.com>
976 * Make-lang.in (doc/g++.1): Use $< to specify the location from
979 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
981 * decl.c (compute_array_index_type): New warning flag warn_vla.
983 2007-03-12 Mark Mitchell <mark@codesourcery.com>
986 * call.c (convert_default_arg): Copy non-constant arguments.
988 2007-03-11 Mark Mitchell <mark@codesourcery.com>
991 * parser.c (cp_parser_postfix_expression): Disallow compound
992 literals in constant expressions.
995 * semantics.c (finish_typeof): Use unlowered_expr_type.
997 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1000 * cp-tree.h (unlowered_expr_type): New function.
1001 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1002 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1003 (unlowered_expr_type): New function.
1004 (build_unary_op): Disallow predecrements of bool bitfields.
1005 * call.c (build_conditional_expr): Use unlowered_expr_type.
1006 * pt.c (type_unification_real): Likewise.
1008 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1011 * typeck.c (check_return_expr): Check for bare parameter packs.
1012 (comptypes): Compare template parameter packs and
1013 type pack expansions.
1014 * decl.c (grokdeclarator): Deal with the declaration of function
1016 (grokparms): Verify that the (optional) function parameter pack is
1017 at the end of the parameter list.
1018 (xref_basetypes): Handle pack expansions in the base class.
1019 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1020 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1021 (NONTYPE_ARGUMENT_PACK): New.
1022 (TYPE_PACK_EXPANSION): New.
1023 (EXPR_PACK_EXPANSION): New.
1024 (ARGUMENT_PACK_SELECT): New.
1025 * cp-objcp-common.c (cp_tree_size): Compute size of
1026 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1027 ARGUMENT_PACK_SELECT.
1028 * error.c (dump_template_argument): Print template argument packs.
1029 (dump_template_argument_list): Ditto.
1030 (dump_template_parameter): Dump `...' for template type parameter
1032 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1033 (dump_parameters): Print function parameter packs.
1034 (dump_template_parms): Print template argument packs.
1035 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1036 (maybe_warn_variadic_templates): New.
1037 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1038 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1039 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1041 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1042 (write_template_arg): Write argument packs as separate arguments.
1043 * cp-tree.h (struct template_parm_index_s): Add flag that
1044 indicates that the template parameter is actually a parameter
1046 (struct tree_argument_pack_select): New.
1047 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1048 (union lang_tree_node): Add argument_pack_select.
1049 (FUNCTION_PARAMETER_PACK_P): New.
1050 (PACK_EXPANSION_P): New.
1051 (PACK_EXPANSION_PATTERN): New.
1052 (SET_PACK_EXPANSION_PATTERN): New.
1053 (PACK_EXPANSION_PARAMETER_PACKS): New.
1054 (ARGUMENT_PACK_P): New.
1055 (ARGUMENT_PACK_ARGS): New.
1056 (SET_ARGUMENT_PACK_ARGS): New.
1057 (ARGUMENT_PACK_INCOMPLETE_P): New.
1058 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1059 (TEMPLATE_PARM_PARAMETER_PACK): New.
1060 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1061 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1062 (ARGUMENT_PACK_SELECT_INDEX): New.
1063 (ARGUMENT_PACK_SELECT_ARG): New.
1064 (struct cp_declarator): Add parameter_pack_p flag.
1065 (maybe_warn_variadic_templates): Declare.
1066 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1067 indicate a template parameter pack.
1068 (uses_parameter_packs): Declare.
1069 (template_parameter_pack_p): Declare.
1070 (template_parms_variadic_p): Declare.
1071 (make_pack_expansion): Declare.
1072 (check_for_bare_parameter_packs): Declare.
1073 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1074 sizeof... expressions.
1075 (pp_cxx_expression): Print pack expansions and non-type argument
1077 (pp_cxx_exception_specification): Print pack expansions.
1078 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1079 (pp_cxx_ctor_initializer): Print pack expansions.
1080 (pp_cxx_type_id): Print pack expansions.
1081 (pp_cxx_template_argument_list): Print argument packs.
1082 (pp_cxx_template_parameter): Print ellipsis for template parameter
1084 * pt.c (comp_template_parms): Compare template parameter packs.
1085 (template_parameter_pack_p): New.
1086 (template_parms_variadic_p): New.
1087 (template_args_variadic_p): New.
1088 (make_ith_pack_parameter_name): New.
1089 (struct find_parameter_pack_data): New.
1090 (find_parameter_packs_r): New.
1091 (uses_parameter_packs): New.
1092 (make_pack_expansion): New.
1093 (check_for_bare_parameter_packs): New.
1094 (expand_template_argument_pack): New.
1095 (reduce_template_parm_level): Propagate parameter pack flag.
1096 (process_template_parm): Add is_parameter_pack parameter to state
1097 when the parameter is actually a parameter pack. Create template
1098 parameter packs when is_parameter_pack is true.
1099 (current_template_args): The argument for a template parameter
1100 pack is an argument pack containing a single pack expansion.
1101 (process_partial_specialization): When checking that non-type
1102 argument expressions do not involve template parameters, loop over
1103 the arguments in argument packs separately.
1104 (push_template_decl_real): Check that the type of the declaration
1105 does not have any bare parameter packs. Check that primary
1106 templates have no more than one parameter pack, and that it comes
1107 at the end of the template parameter list.
1108 (convert_template_argument): Handle coercions for pack expansion
1109 expressions by coercing the pattern then rebuilding the expansion.
1110 (coerce_template_parms): When coercing the arguments for a
1111 variadic template, pack "extra" arguments into an argument pack.
1112 (coerce_template_template_parms): Cannot coerce between parameter
1113 packs and non-pack parameters.
1114 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1115 (comp_template_args): Expand all template arguments packs before
1116 comparing template argument lists.
1117 (mangle_class_name_for_template): Make argument packs as separate
1119 (for_each_template_parm_r): No need to handle BASELINK.
1120 (instantiate_class_template): Handle pack expansions in the base
1122 (tsubst_pack_expansion): New.
1123 (tsubst_template_args): Handle substitutions of argument packs and
1124 pack expansion into template argument lists.
1125 (tsubst_decl): Expand function parameter packs into separate
1126 function parameters.
1127 (tsubst_arg_types): Expand a type pack expansion into separate
1129 (tsubst_exception_specification): Handle pack expansions in
1130 exception specifiers.
1131 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1132 replacing a template parameter with its argument. If we encounter
1133 a substitution for an argument pack, just return the parameter
1135 (tsubst_copy): sizeof(X...) returns the number of elements in
1136 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1137 PARM_DECL is a parameter pack.
1138 (tsubst_expr): Expression pack expansions and argument packs
1139 cannot show up here; they will all be handled through function
1140 calls, sizeof, and template argument lists.
1141 (tsubst_copy_and_build): sizeof(X...) returns the number of
1142 elements in parameter pack X. Handle pack expansions in TREE_LIST
1143 and CONSTRUCTOR nodes.
1144 (fn_type_unification): Handle "incomplete" explicit template
1145 argument lists that specify some of the arguments for a template
1147 (type_unification_real): Unify arguments against pack expansions.
1148 (template_parm_level_and_index): New, helper function.
1149 (unify_pack_expansion): New.
1150 (unify): Unify argument packs on an argument-by-argument basis,
1151 handling variadic argument packs as well.
1152 (more_specialized_fn): Handle unification of function parameter
1153 packs. All things being equal, prefer non-variadic function
1154 templates to variadic function templates.
1155 (more_specialized_class): Prefer the variadic class template
1156 partial specialization that binds fewer arguments to a parameter
1158 (regenerate_decl_from_template): Expand function parameter packs
1159 into separate parameters.
1160 (instantiate_decl): Ditto.
1161 (tsubst_initializer_list): Handle pack expansions for base-class
1163 (dependent_type_p_r): Determine dependent types in argument packs
1164 and pack expansions.
1165 (value_dependent_expression_p): Determine value-dependence of
1166 non-type argument packs.
1167 (dependent_template_arg_p): Handle argument packs.
1168 * semantics.c (finish_cond): Check for bare parameter packs.
1169 (finish_expr_stmt): Ditto.
1170 (finish_for_expr): Ditto.
1171 (finish_switch_cond): Ditto.
1172 (finish_mem_initializers): Ditto.
1173 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1175 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1176 * parser.c (make_declarator): Declarator is not an expansion.
1177 (make_pointer_declarator): Transfer parameter pack flag to outer
1179 (make_reference_declarator): Ditto.
1180 (make_ptrmem_declarator): Ditto.
1181 (make_call_declarator): Ditto.
1182 (make_array_declarator): Ditto.
1183 (cp_parser_postfix_expression): Allow pack expansion expressions
1184 in the argument list for a call expression.
1185 (cp_parser_parenthesized_expression_list): Add new parameter
1186 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1187 into separate arguments."
1188 (cp_parser_new_placement): Allow pack expansion expressions.
1189 (cp_parser_new_initializer): Ditto.
1190 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1191 base-class initializer expansion.
1192 (cp_parser_mem_initializer): Ditto.
1193 (cp_parser_template_parameter_list): Keep track of whether the
1194 template parameter is a template parameter pack.
1195 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1196 template parameter pack.
1197 (cp_parser_type_parameter): Ditto.
1198 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1200 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1201 this declarator is a parameter pack.
1202 (cp_parser_parameter_declaration): The ellipsis does not end the
1203 parameter declaration, because it might be a parameter pack. Parse
1204 the ellipsis to indicate a parameter pack.
1205 (cp_parser_initializer): Allow pack expansions.
1206 (cp_parser_initializer_list): Allow ellipsis to create an
1207 initializer expansion.
1208 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1210 (cp_parser_type_id_list): Allow ellipsis to create an exception
1211 specifier expansion.
1212 (cp_parser_attribute_list): Don't allow pack expansions.
1213 (cp_parser_functional_cast): Allow pack expansions.
1214 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1215 compute the length of a parameter pack.
1216 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1217 end a template argument.
1218 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1219 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1222 2007-03-09 Dirk Mueller <dmueller@suse.de>
1224 * cp/call.c (build_new_op): Call warn_logical_operator.
1226 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1229 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1232 * pt.c (any_template_arguments_need_structural_equality_p):
1235 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1237 * decl.c (grokdeclarator): Disable warnings for anonymous
1240 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1242 * typeck2.c (readonly_error): Always emit a hard error.
1243 Remove last argument.
1244 * cp-tree.h (readonly_error): Adjust prototype.
1245 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1246 * typeck.c (build_unary_op): Likewise.
1247 (build_modify_expr): Likewise.
1249 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1252 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1254 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1257 * parser.c (struct cp_parser): New IN_IF_STMT.
1258 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1259 returning if parsing the body of an 'if' statement or issuing an
1260 error and continuing.
1261 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1263 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1265 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1268 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1271 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1273 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1274 Objective-C++. Don't exit early if -shared-libgcc needs to be
1277 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1279 * typeck.c (common_base_type): Delete unused function.
1281 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1283 * Make-lang.in: Add dummy lang.install-pdf target.
1285 2007-03-01 Simon Baldwin <simonb@google.com>
1288 * decl.c (check_tag_decl): Added new warning for typedef ignored
1289 when it precedes an otherwise valid non-typedef declaration.
1291 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1293 * typeck.c (build_function_call): Store converted arguments
1294 in a stack-allocated array instead of building a list.
1295 (convert_arguments): Store arguments in the array passed in as an
1296 argument, and return the actual number of arguments.
1297 * call.c (build_call): Delete, and replace with...
1298 (build_call_n, build_call_a): New.
1299 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1300 (build_over_call): Store converted arguments in a stack-allocated
1301 array instead of building a list.
1302 (build_cxx_call): Pass arguments in an array instead of as a list.
1303 (build_java_interface_fn_ref): Rewrite to avoid constructing
1305 * tree.h: Update declarations to reflect above changes.
1306 * method.c (use_thunk): Use a stack-allocated array to hold
1307 the arguments instead of a list.
1308 * rtti.c (throw_bad_cast): Update call to cxx_call.
1309 (throw_bad_typeid): Likewise.
1310 (build_dynamic_cast_1): Likewise.
1311 * init.c (build_builtin_delete_call): Use build_call_n.
1312 * decl.c (expand_static_init): Likewise.
1313 * except.c (cp_protect_cleanup_actions): Likewise.
1314 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1315 (gimplify_must_not_throw_expr): Likewise.
1316 (cxx_omp_apply_fn): Use build_call_a.
1318 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1320 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1321 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1323 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1325 * cp-tree.h (static_ctors): Remove.
1326 * cp-tree.h (static_dtors): Likewise.
1327 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1328 refactoring of tree_map hierarchy.
1329 (decl_shadowed_for_var_insert): Likewise.
1330 * semantics.c (expand_body): Use c_expand_body.
1331 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1332 * decl2.c (static_ctors): Remove.
1333 (static_dtors): Likewise.
1334 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1335 objc_generate_static_init_call. Do not call static_[cd]tors.
1336 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1338 (cp_write_global_declarations): Likewise.
1340 2007-02-23 Richard Guenther <rguenther@suse.de>
1342 * class.c (note_name_declared_in_class): Make declaration
1343 changes meaning a pedwarn.
1345 2007-02-22 Michael Matz <matz@suse.de>
1348 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1349 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1350 dump_function_decl): Guard emitting outer scopes by new flag.
1351 * cp-lang.c (cxx_dwarf_name): New function.
1352 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1353 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1355 (push_template_decl_real, lookup_template_class): Remove calls
1358 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1360 * call.c (build_new_method_call): Ensure that explicit calls of
1361 destructors have type "void".
1363 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1365 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1366 and -Walways-true with -Waddress.
1367 * cvt.c (convert_to_void): Replace unconditional warning with
1370 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1372 * decl.c, tree.c: Fix comment typos.
1374 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1377 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1378 statement expression if we had an error mark node.
1380 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1381 Brooks Moses <brooks.moses@codesourcery.com>
1382 Lee Millward <lee.millward@codesourcery.com>
1384 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1385 Change class to tcc_vl_exp.
1387 * call.c (build_call): Use build_call_list instead
1389 (build_over_call): Likewise.
1390 (build_new_method_call): Use build_min_non_dep_call_list
1391 instead of build_min_non_dep.
1393 * error.c (dump_call_expr_args): New function.
1394 (dump_aggr_init_expr_args): New function.
1395 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1396 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1398 * cvt.c (convert_to_void): Use build_call_array instead
1399 of build3; use new AGGR_INIT_EXPR accessor macros.
1401 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1402 instead of TREE_CODE_LENGTH.
1404 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1405 AGGR_INIT_EXPR accessor macros.
1407 * cp-gimplify.c (cp_gimplify_init_expr): Use
1408 AGGR_INIT_EXPR_SLOT to set the slot operand.
1410 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1411 (AGGR_INIT_EXPR_SLOT): New macro.
1412 (AGGR_INIT_EXPR_ARG): New macro.
1413 (aggr_init_expr_nargs): New macro.
1414 (AGGR_INIT_EXPR_ARGP): New macro.
1415 (aggr_init_expr_arg_iterator): New.
1416 (init_aggr_init_expr_arg_iterator): New.
1417 (next_aggr_init_expr_arg): New.
1418 (first_aggr_init_expr_arg): New.
1419 (more_aggr_init_expr_args_p): New.
1420 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1421 (stabilize_aggr_init): New declaration.
1422 (build_min_non_dep_call_list): Likewise.
1424 * tree.c (process_aggr_init_operands): New function.
1425 (build_aggr_init_array) New function.
1426 (build_cplus_new): Update to use new CALL_EXPR and
1427 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1428 build_aggr_init_array.
1429 (build_min_non_dep_call_list) New function.
1430 (build_min_nt): Assert input code parameter is not a variable
1431 length expression class.
1432 (build_min, build_min_non_dep): Likewise.
1433 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1434 to check for equality instead of recursing. Handle tcc_vl_exp
1436 (stabilize_call): Update to only handle CALL_EXPRs, not
1437 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1438 (stabilize_aggr_init): New function.
1439 (stabilize_init): Use it.
1441 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1442 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1443 AGGR_INIT_EXPR accessor macros and argument iterators.
1445 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1446 build_vl_exp. Iterate through the operands, recursively
1447 processing each one.
1448 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1449 CALL_EXPR accessor macros.
1450 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1451 tree code classes. Use TREE_OPERAND_LENGTH instead of
1454 * semantics.c (finish_call_expr): Use build_nt_call_list
1455 instead of build_nt.
1456 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1457 accessor macros. Use build_call_array to construct the
1458 CALL_EXPR node instead of build3
1460 * decl2.c (build_offset_ref_call_from_tree): Use
1461 build_nt_call_list and build_min_non_dep_call_list instead
1462 of build_min_nt and build_min_non_dep.
1464 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1465 Use build_nt_call_list instead of build_min_nt.
1467 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1470 * call.c (build_conditional_expr): Improve error message.
1472 2007-02-13 Dirk Mueller <dmueller@suse.de>
1474 * friend.c (do_friend): Annotate warning about friend
1475 declarations in templates with OPT_Wnon_template_friend.
1476 Convert informal message from warning() to inform().
1478 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1479 Mark Mitchell <mark@codesourcery.com>
1482 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1483 instantiations for variables.
1485 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1488 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1489 Check warn_unused_value just once.
1491 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1494 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1495 (fn_type_unificiation): Likewise.
1496 (get_bindings): Likewise.
1498 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1501 * decl.c (finish_function): Use DECL_REPLACEABLE.
1502 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1504 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1506 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1508 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1510 * decl.c (grokvardecl): Don't error if !have_tls.
1511 (grokdeclarator): Likewise.
1512 * parser.c (cp_parser_omp_threadprivate): Likewise.
1514 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1517 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1518 parameters and result decls in omp clauses.
1519 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1522 2007-02-05 Dirk Mueller <dmueller@suse.de>
1525 * parser.c (cp_parser_class_specifier): Always initialize bases.
1527 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1529 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1530 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1531 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1533 * semantics.c (finish_omp_atomic): Store a whole expression node
1534 in operand 1, and integer_zero_node in operand 0, for dependent
1535 OMP_ATOMIC. Rewrite to make flow easier to understand.
1537 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1539 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1541 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1543 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1544 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1546 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1548 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1549 keyword warning to -Wc++0x-compat.
1551 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1553 * decl.c (grokdeclarator): Update documentation.
1555 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1558 * decl.c (grokdeclarator): If __thread is used together with
1559 a storage class other than extern and static, clear thread_p
1560 after issuing diagnostics and fall through to checking the
1563 2007-01-30 Roger Sayle <roger@eyesopen.com>
1565 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1566 calculating the size of an array (to avoid recursive errors).
1568 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1571 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1573 * call.c (convert_like_real): Don't warn when converting to
1576 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1578 * decl.c (pop_label): Replace warning with call to
1579 warn_for_unused_label.
1581 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1584 * semantics.c (finish_pseudo_destructor_expr): Check the
1585 destrutor name by calling check_dtor_name.
1587 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1589 * lex.c (D_CPP0X): Rename.
1591 (reswords): D_CPP0X -> D_CXX0X.
1592 (init_reswords): Ditto.
1593 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1594 of C++0x keywords as identifiers.
1596 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1599 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1602 2007-01-23 Ian Lance Taylor <iant@google.com>
1604 * typeck.c (convert_for_assignment): Only warn about a = b = c
1605 when converting to bool.
1607 2007-01-23 Roger Sayle <roger@eyesopen.com>
1609 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1611 * typeck.c (ignore_overflows): Remove the remaining uses of
1612 TREE_CONSTANT_OVERFLOW.
1614 2007-01-20 Jan Hubicka <jh@suse.cz>
1616 * decl2.c (start_objects, start_static_storage_duration_function):
1617 Do not make the functions uninlinable.
1619 2007-01-17 Ian Lance Taylor <iant@google.com>
1621 * class.c (add_method): Call VEC_reserve_exact rather than passing
1622 a negative size to VEC_reserve.
1624 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1627 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1629 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1632 * decl.c (make_typename_type): If the qualified name is not a
1633 type, issue an error.
1634 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1637 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1639 * rtti.c: Include target.h.
1640 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1641 don't emit typeinfo for fundamental types as weak.
1642 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1644 2007-01-08 Richard Guenther <rguenther@suse.de>
1646 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1648 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1650 * call.c (standard_conversion): Pass flag to
1651 vector_types_convertible_p to disallow emission of note.
1652 * typeck.c (convert_for_assignment): Pass flag to
1653 vector_types_convertible_p to allow emission of note.
1654 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1655 to disallow emission of note.
1657 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1660 * typeck.c (build_binary_op): Call overflow_warning if
1661 TREE_OVERFLOW_P is true for the result and not for any of the
1664 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1667 * class.c (add_method): Don't wait until template
1668 instantiation time to complain about duplicate methods.
1670 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1673 * semantics.c (finish_unary_op_expr): Warn only if result
1674 overflowed and operands did not.
1676 2007-01-05 Ian Lance Taylor <iant@google.com>
1678 * typeck.c (build_binary_op): Warn about comparing a non-weak
1681 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1683 * pt.c (tsubst): Propagate the need for structural equality checks
1684 when reducing the level of template parameters.
1686 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1688 * pt.c: Fix a comment typo.
1690 2007-01-02 Ian Lance Taylor <iant@google.com>
1692 * semantics.c (maybe_convert_cond): Optionally warn when using an
1693 assignment as a condition.
1694 * typeck.c (convert_for_assignment): Optionally warn about
1695 assigning the result of an assignment to a bool.
1697 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1699 * pt.c (canonical_template_parms): Correct typo in comment.
1701 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1703 * typeck.c (structural_comptypes): Renamed from "comptypes".
1704 (comptypes): Use canonical type information to perform fast type
1705 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1706 canonical type comparison returns the same results as we would see
1707 from the current, structural check. Support COMPARE_STRUCTURAL
1708 when we need structural checks.
1709 * decl.c (typename_compare): Fix comment.
1710 (build_typename_type): TYPENAME_TYPE nodes require structural
1711 equality checks, because they resolve different based on the
1713 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1714 require structural equality checks (for now).
1715 (build_ptrmemfunc_type): Build the canonical pointer to member
1717 (compute_array_index_type): Whenever we build a new index type
1718 to represent the size of an array in a template, we need to mark
1719 this index type as requiring structural equality. This goes for
1720 arrays with value-dependent sizes with the current ABI, or all
1722 * tree.c (cplus_array_hash): New.
1723 (struct cplus_array_info): New.
1724 (cplus_array_compare): New.
1725 (cplus_array_htab): New.
1726 (build_cplus_array_type_1): Use a hash table to cache the array
1727 types we build. Build the canonical array type for each array
1729 (cp_build_qualified_type_real): When building a cv-qualified array
1730 type, use the hash table of array types and build canonical array
1732 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1733 use structural equality (for now).
1734 * cp-tree.h (COMPARE_STRUCTURAL): New.
1735 * pt.c (canonical_template_parms): New.
1736 (canonical_type_parameter): New.
1737 (process_template_parm): Find the canonical type parameter.
1738 (lookup_template_class): When we have named the primary template
1739 type, set the canonical type for our template class to the primary
1740 template type. If any of the template arguments need structural
1741 equality checks, the template class needs structural equality
1743 (tsubst): When reducing the level of a template template
1744 parameter, we require structural equality tests for the resulting
1745 parameter because its template parameters have not had their types
1746 canonicalized. When reducing a template type parameter, find the
1747 canonical reduced type parameter.
1748 (any_template_arguments_need_structural_equality_p): New.