1 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
2 Douglas Gregor <doug.gregor@gmail.com>
3 Pedro Lamarao <pedro.lamarao@mndfck.org>
4 Howard Hinnant <howard.hinnant@gmail.com>
8 * typeck.c (comptypes): Don't consider rvalue and lvalue
9 reference types to be equivalent.
10 (check_return_expr): Move from certain lvalues when returning
12 * decl.c (grokdeclarator): Implement reference collapsing.
13 (copy_fn_p): Don't consider constructors taking rvalue references
14 to be copy constructors.
16 * call.c (conversion): New "rvaluedness_matches_p" member.
17 (convert_class_to_reference): Require reference type as first
18 parameter instead of base type.
19 (reference_binding): Add logic to handle rvalue references.
20 (implicit_conversion): Update inaccurate comment.
21 (convert_like_real): Disable creation of temporaries that are
22 impossible to initialize for types with move constructors.
23 (build_over_call): Elide move constructors when possible.
24 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
25 (maybe_handle_ref_bind): Return conversion instead of type node.
26 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
27 determine preferred conversion sequences.
28 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
29 (LOOKUP_PREFER_RVALUE): New.
30 (DECL_MOVE_CONSTRUCTOR_P): New.
31 (struct cp_declarator): Add "reference" member for reference
32 types, with new "rvalue_ref" flag.
33 (cp_build_reference_type): Declare.
35 * error.c (dump_type_prefix): Format rvalue reference types
36 correctly in error messages.
37 * except.c (build_throw): Move from certain lvalues when
39 * mangle.c (write_type): Mangle rvalue references differently
40 than regular references.
41 * parser.c (make_reference_declarator): Add boolean parameter for
43 (cp_parser_make_indirect_declarator): New.
44 (cp_parser_new_declarator_opt): Call
45 cp_parser_make_indirect_declarator.
46 (cp_parser_conversion_declarator_opt): Ditto.
47 (cp_parser_declarator): Ditto.
48 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
50 * pt.c (tsubst): Implement reference collapsing.
51 (maybe_adjust_types_for_deduction): Implement special template
52 parameter deduction rule for rvalue references.
53 (type_unification_real): Update calls to
54 maybe_adjust_types_for_deduction.
55 (try_one_overload): Ditto.
56 (unify_pack_expansion): Ditto.
57 * tree.c (lvalue_p_1): Handle rvalue reference types.
58 (cp_build_reference_type): New.
60 2007-05-30 Jakub Jelinek <jakub@redhat.com>
63 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
64 variables that need runtime initialization.
66 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
69 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
70 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
71 case POSTDECREMENT_EXPR>): Return the error_mark_node
72 if either the real or imaginary parts would an
75 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
76 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
79 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
80 token is a closing brace, false if there are no tokens left.
81 (cp_parser_namespace_alias_definition): Only consume the next token if
82 it is a closing brace.
84 * parser.c (cp_parser_class_specifier): Likewise.
86 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
88 * semantics.c (finish_member_declaration): Fix a typo in the
91 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
103 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
104 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
105 * pt.c (check_for_bare_parameter_packs): Return bool indicated
106 whether everything was okay. Fix indentation.
107 (push_template_decl_real): Check for bare parameter packs in
108 function parameters; where errors occur, mark the parameter types
109 with ERROR_MARK_NODEs to avert ICEs.
110 (coerce_template_parameter_pack): New.
111 (coerce_template_parms): Moved parameter pack coercion into
112 coerce_template_parameter_pack, and permit it anywhere in the
113 template parameter list (not just at the end). Parameter and
114 argument indices can vary (somewhat) separately now, so add
115 PARM_IDX and ARG_IDX.
116 (fn_type_unification): Don't set an argument pack as incomplete if
117 no argument pack was deduced.
118 (type_unification_real): If a type parameter is a parameter pack
119 and has not otherwise been deduced, it will be deduced to an empty
121 (more_specialized_fn): Use the actual lengths of the argument
122 lists when comparing against expansions.
123 * semantics.c (finish_member_declaration): If a field's type has
124 bare parameter packs, error and set its type to ERROR_MARK_NODE.
126 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
129 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
131 2007-05-22 Ollie Wild <aaw@google.com>
133 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
134 (unqualified_namespace_lookup): Adds check for hidden types.
136 2007-05-22 Ollie Wild <aaw@google.com>
138 * decl.c (duplicate_decls): Verify namespace names are unique.
140 2007-05-21 Mark Mitchell <mark@codesourcery.com>
142 * decl.c (cxx_maybe_build_cleanup): Handle
143 __attribute__((cleanup)).
145 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
147 * cvt.c (cp_convert_and_check): Don't check warnings if the
150 2007-05-18 Geoffrey Keating <geoffk@apple.com>
152 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
154 2007-05-14 Paolo Carlini <pcarlini@suse.de>
157 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
158 type only if is a class type (5.2.8/4).
160 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
162 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
163 * decl.c (grokdeclarator): Use unsigned_type_for instead of
164 c_common_unsigned_type.
166 2007-05-11 Silvius Rus <rus@google.com>
168 * cp/typeck.c (build_indirect_ref): Add call to
169 strict_aliasing_warning.
170 (build_reinterpret_cast_1): Condition call to
171 strict_aliasing_warning.
173 2007-05-11 Jan Hubicka <jh@suse.cz>
175 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
176 * decl2.c (start_objects): ctors and dtors are no longer public.
177 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
179 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
181 * typeck.c (build_unary_op): Remove code that used to
182 handle non lvalue increments/decrements.
184 2007-05-07 Mike Stump <mrs@apple.com>
186 * parser.c (check_empty_body): Add.
187 (cp_parser_iteration_statement): Add call to check_empty_body.
189 2007-05-05 Geoffrey Keating <geoffk@apple.com>
192 * mangle.c (write_mangled_name): Mangle static variable names.
193 (write_unqualified_name): Use local-source-name for
194 namespace-scope static variables.
196 2007-05-04 Dirk Mueller <dmueller@suse.de>
198 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
201 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
204 * decl2.c (constrain_class_visibility):
205 Use strip_pointer_or_array_types instead of strip_array_types.
207 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
210 * decl.c (reshape_init_r): Don't reshape the first element if it
211 is a pointer to member function.
213 2007-04-27 Simon Baldwin <simonb@google.com>
215 * decl.c (grokparms): Changed message format from %qD to %qE.
217 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
219 * error.c (maybe_warn_variadic_templates): Variadic templates are
220 now in C++0x, so only warn about them in C++98 mode.
222 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
225 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
226 integeral types from vectors types.
228 2007-04-26 Jakub Jelinek <jakub@redhat.com>
231 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
232 for type dependent OMP_CLAUSE_DECLs.
234 2007-04-24 Mark Mitchell <mark@codesourcery.com>
237 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
238 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
239 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
240 * init.c (build_zero_init): Adjust, as
241 COMPLEX_TYPE is now a SCALAR_TYPE.
242 * typeck2.c (digest_init): Allow brace-enclosed initializers for
243 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
245 2007-04-25 Paolo Carlini <pcarlini@suse.de>
247 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
248 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
249 (trait_expr_value): Adjust.
251 2007-04-23 Simon Baldwin <simonb@google.com>
253 * decl.c (grokparms): Added new error for duplicate function
254 parameters names in function prototypes, to match gcc behavior.
256 2007-04-23 Jan Hubicka <jh@suse.cz>
258 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
261 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
263 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
264 instead of checking GIMPLE_STMT_P in chain_next.
266 2007-04-17 Mark Mitchell <mark@codesourcery.com>
269 * call.c (convert_for_arg_passing): Convert bitfields to their
272 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
275 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
277 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
281 * cp/decl2.c (constrain_class_visibility):
282 Do not warn about the use of anonymous namespace in the main input file.
284 2007-04-15 Mark Mitchell <mark@codesourcery.com>
286 * cp-tree.h (current_template_parms): Fix typo in comment.
288 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
290 * cp-tree.h, error.c: Fix comment typos.
292 2007-04-13 Jason Merrill <jason@redhat.com>
295 * call.c (reference_binding): Add c_cast_p parm. If true,
296 add quals to TO as needed to make it reference-compatible.
298 2007-04-11 Jan Hubicka <jh@suse.cz>
300 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
301 that we are not processing template_decl.
303 2007-04-09 Mark Mitchell <mark@codesourcery.com>
306 * class.c (build_base_path): Ensure that the converted pointer has
307 the same cv-qualification as the input.
309 2007-04-09 Paolo Carlini <pcarlini@suse.de>
311 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
313 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
315 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
317 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
318 * tree.c (cp_add_pending_fn_decls): Remove.
319 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
321 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
323 Revert change removing staticp.
325 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
327 * cp-objcp-common.c (cxx_staticp): Remove.
328 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
329 * cp-tree.h (cxx_staticp):
331 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
333 * class.c (check_for_override): Don't remove dllmport attribute
336 2007-04-03 Jakub Jelinek <jakub@redhat.com>
339 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
340 type issue error and return early.
342 2007-03-30 Jason Merrill <jason@redhat.com>
345 * typeck.c (cp_type_readonly): New fn.
346 * cp-tree.h: Declare it.
347 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
348 (cp_finish_decl): Not here.
350 2007-03-31 Richard Guenther <rguenther@suse.de>
352 * optimize.c (maybe_clone_body): Replace splay-tree usage by
355 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
360 * parser.c (declarator_can_be_parameter_pack): New.
361 (cp_parser_template_parameter): Only parse the `...' if the
362 declarator can be a parameter pack.
363 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
365 * pt.c (find_parameter_packs_r): Look into the bounds on integer
366 types (they could be used as array bounds).
367 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
368 (tsubst_pack_expansion): Handle failure to expand parameter
371 2007-03-30 Paolo Carlini <pcarlini@suse.de>
374 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
375 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
376 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
377 (CLASS_TYPE_NON_UNION_P): Add.
378 (struct lang_type_class): Add has_complex_dflt.
379 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
380 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
381 * cp-tree.def: Add TRAIT_EXPR.
382 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
383 * lex.c (struct resword): Add __has_nothrow_assign,
384 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
385 __has_trivial_constructor, __has_trivial_copy,
386 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
387 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
388 __is_pod, __is_polymorphic, __is_union.
389 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
390 (cp_parser_trait_expr): New.
391 * semantics.c (finish_trait_expr, trait_expr_value
392 classtype_has_nothrow_copy_or_assign_p): New.
393 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
395 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
396 * class.c (check_bases, check_field_decl, check_bases_and_members):
397 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
398 * pt.c (uses_template_parms, tsubst_copy_and_build,
399 value_dependent_expression_p, type_dependent_expression_p): Deal with
401 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
403 2007-03-29 Richard Guenther <rguenther@suse.de>
405 * tree.c (cp_walk_subtrees): Do not set input_location.
407 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
410 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
413 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
415 * parser.c (struct cp_parser): Update comment for
416 greater_than_is_operator_p.
417 (cp_parser_primary_expression): In C++0x mode, a cast operator can
418 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
419 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
420 !GREATER_THAN_IS_OPERATOR_P.
421 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
422 `>>' operators that will become two `>' tokens in C++0x.
423 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
424 mode, allowing it to terminate default arguments.
425 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
426 `>>' like two consecutive `>' tokens.
427 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
428 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
429 ends a template argument.
431 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
433 * decl.c (redeclaration_error_message): Complain when redeclaring
434 a friend function with default template arguments (C++0x mode only).
435 * cp-tree.h (check_default_tmpl_args): Declare.
436 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
437 template arguments in function templates. Add support for checking
438 the default template arguments of friend templates.
439 (push_template_decl_real): Fix call to check_default_tmpl_args.
440 (type_unification_real): If a template parameter has not been
441 deduced but provides a default template argument, substitute into
442 that default template argument.
443 * parser.c (cp_parser_init_declarator): When declaring (but not
444 defining!) a function template in C++0x mode, check for default
447 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
450 * decl.c (grokdeclarator): Deal with cv-qualified function type
451 typedefs in the same way for member and non-member functions.
453 2007-03-26 Dirk Mueller <dmueller@suse.de>
455 * parser.c (cp_parser_member_declaration): Pedwarn
456 about stray semicolons after member declarations.
458 2007-03-26 Paolo Carlini <pcarlini@suse.de>
461 * pt.c (instantiate_decl): Set in_system_header.
463 2007-03-22 Mark Mitchell <mark@codesourcery.com>
465 * cp-tree.h (current_tempalte_parms): Improve documentation.
466 * pt.c (current_template_args): Likewise.
469 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
470 not consume tokens when failing.
472 2007-03-22 Jim Wilson <wilson@specifix.com>
473 Mark Mitchell <mark@codesourcery.com>
476 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
477 consistent with FROM.
479 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
481 * error.c (dump_expr): Handle dependent names that designate types.
482 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
484 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
486 * cp-tree.def, parser.c, pt.c: Fix comment typos.
488 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
490 * cvt.c (cp_convert_and_check) : Define.
491 * cp-tree.h (cp_convert_and_check): Declare.
492 * call.c (convert_conversion_warnings): Rename to
493 conversion_null_warnings. The warning for floating-point to
494 integer is handled by convert_and_check in convert_like_real.
495 (convert_like_real): convert_conversion_warnings was renamed as
496 conversion_null_warnings.
497 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
498 overflow and changes of value during conversion.
500 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
503 * parser.c (cp_parser_statement): If 'namespace' is found, this
504 only can be a namespace alias definition, so parse it now.
505 (cp_parser_namespace_alias_definition): if we find an open brace
506 instead of '=', then this is actually a misplaced namespace
509 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
512 * decl.c (cxx_init_decl_processing): Move command-line options
513 processing to c-opts.c.
515 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
517 * ptree.c (cxx_print_type): Use formatting markup for integers
518 when printing template parameter index/level/orig level.
519 (cxx_print_xnode): Ditto.
520 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
521 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
522 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
524 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
525 rather than a HOST_WIDE_INT.
526 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
527 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
529 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
530 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
531 IN_BASE_INITIALIZER bool bitfields.
532 (struct cp_declarator): Make KIND a 4-bit field. Make
533 PARAMETER_PACK_P a bool bitfield just after KIND.
534 * pt.c (uses_parameter_packs): Destroy the pointer set.
535 (make_pack_expansion): Ditto.
536 (check_for_bare_parameter_packs): Ditto.
537 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
539 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
542 * call.c (convert_default_arg): Instead of copying the node,
545 2007-03-15 Dirk Mueller <dmueller@suse.de>
548 * call.c (convert_conversion_warnings): New..
549 (convert_like_real): .. factored out from here.
550 (convert_conversion_warnings): Add warning about
551 false being converted to NULL in argument passing.
553 2007-03-14 Dirk Mueller <dmueller@suse.de>
555 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
556 (finish_do_body): Warn about empty body in do/while statement.
558 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
560 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
562 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
565 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
568 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
570 * cp/repo.c (init_repo): Initialize random_seed saved options.
571 (finish_repo): Adjust.
573 2007-03-13 Mark Mitchell <mark@codesourcery.com>
576 * Make-lang.in (doc/g++.1): Use $< to specify the location from
579 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
581 * decl.c (compute_array_index_type): New warning flag warn_vla.
583 2007-03-12 Mark Mitchell <mark@codesourcery.com>
586 * call.c (convert_default_arg): Copy non-constant arguments.
588 2007-03-11 Mark Mitchell <mark@codesourcery.com>
591 * parser.c (cp_parser_postfix_expression): Disallow compound
592 literals in constant expressions.
595 * semantics.c (finish_typeof): Use unlowered_expr_type.
597 2007-03-10 Mark Mitchell <mark@codesourcery.com>
600 * cp-tree.h (unlowered_expr_type): New function.
601 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
602 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
603 (unlowered_expr_type): New function.
604 (build_unary_op): Disallow predecrements of bool bitfields.
605 * call.c (build_conditional_expr): Use unlowered_expr_type.
606 * pt.c (type_unification_real): Likewise.
608 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
611 * typeck.c (check_return_expr): Check for bare parameter packs.
612 (comptypes): Compare template parameter packs and
613 type pack expansions.
614 * decl.c (grokdeclarator): Deal with the declaration of function
616 (grokparms): Verify that the (optional) function parameter pack is
617 at the end of the parameter list.
618 (xref_basetypes): Handle pack expansions in the base class.
619 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
620 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
621 (NONTYPE_ARGUMENT_PACK): New.
622 (TYPE_PACK_EXPANSION): New.
623 (EXPR_PACK_EXPANSION): New.
624 (ARGUMENT_PACK_SELECT): New.
625 * cp-objcp-common.c (cp_tree_size): Compute size of
626 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
627 ARGUMENT_PACK_SELECT.
628 * error.c (dump_template_argument): Print template argument packs.
629 (dump_template_argument_list): Ditto.
630 (dump_template_parameter): Dump `...' for template type parameter
632 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
633 (dump_parameters): Print function parameter packs.
634 (dump_template_parms): Print template argument packs.
635 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
636 (maybe_warn_variadic_templates): New.
637 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
638 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
639 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
641 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
642 (write_template_arg): Write argument packs as separate arguments.
643 * cp-tree.h (struct template_parm_index_s): Add flag that
644 indicates that the template parameter is actually a parameter
646 (struct tree_argument_pack_select): New.
647 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
648 (union lang_tree_node): Add argument_pack_select.
649 (FUNCTION_PARAMETER_PACK_P): New.
650 (PACK_EXPANSION_P): New.
651 (PACK_EXPANSION_PATTERN): New.
652 (SET_PACK_EXPANSION_PATTERN): New.
653 (PACK_EXPANSION_PARAMETER_PACKS): New.
654 (ARGUMENT_PACK_P): New.
655 (ARGUMENT_PACK_ARGS): New.
656 (SET_ARGUMENT_PACK_ARGS): New.
657 (ARGUMENT_PACK_INCOMPLETE_P): New.
658 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
659 (TEMPLATE_PARM_PARAMETER_PACK): New.
660 (TEMPLATE_TYPE_PARAMETER_PACK): New.
661 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
662 (ARGUMENT_PACK_SELECT_INDEX): New.
663 (ARGUMENT_PACK_SELECT_ARG): New.
664 (struct cp_declarator): Add parameter_pack_p flag.
665 (maybe_warn_variadic_templates): Declare.
666 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
667 indicate a template parameter pack.
668 (uses_parameter_packs): Declare.
669 (template_parameter_pack_p): Declare.
670 (template_parms_variadic_p): Declare.
671 (make_pack_expansion): Declare.
672 (check_for_bare_parameter_packs): Declare.
673 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
674 sizeof... expressions.
675 (pp_cxx_expression): Print pack expansions and non-type argument
677 (pp_cxx_exception_specification): Print pack expansions.
678 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
679 (pp_cxx_ctor_initializer): Print pack expansions.
680 (pp_cxx_type_id): Print pack expansions.
681 (pp_cxx_template_argument_list): Print argument packs.
682 (pp_cxx_template_parameter): Print ellipsis for template parameter
684 * pt.c (comp_template_parms): Compare template parameter packs.
685 (template_parameter_pack_p): New.
686 (template_parms_variadic_p): New.
687 (template_args_variadic_p): New.
688 (make_ith_pack_parameter_name): New.
689 (struct find_parameter_pack_data): New.
690 (find_parameter_packs_r): New.
691 (uses_parameter_packs): New.
692 (make_pack_expansion): New.
693 (check_for_bare_parameter_packs): New.
694 (expand_template_argument_pack): New.
695 (reduce_template_parm_level): Propagate parameter pack flag.
696 (process_template_parm): Add is_parameter_pack parameter to state
697 when the parameter is actually a parameter pack. Create template
698 parameter packs when is_parameter_pack is true.
699 (current_template_args): The argument for a template parameter
700 pack is an argument pack containing a single pack expansion.
701 (process_partial_specialization): When checking that non-type
702 argument expressions do not involve template parameters, loop over
703 the arguments in argument packs separately.
704 (push_template_decl_real): Check that the type of the declaration
705 does not have any bare parameter packs. Check that primary
706 templates have no more than one parameter pack, and that it comes
707 at the end of the template parameter list.
708 (convert_template_argument): Handle coercions for pack expansion
709 expressions by coercing the pattern then rebuilding the expansion.
710 (coerce_template_parms): When coercing the arguments for a
711 variadic template, pack "extra" arguments into an argument pack.
712 (coerce_template_template_parms): Cannot coerce between parameter
713 packs and non-pack parameters.
714 (template_args_equal): Compare PACK_EXPANSION_P expressions.
715 (comp_template_args): Expand all template arguments packs before
716 comparing template argument lists.
717 (mangle_class_name_for_template): Make argument packs as separate
719 (for_each_template_parm_r): No need to handle BASELINK.
720 (instantiate_class_template): Handle pack expansions in the base
722 (tsubst_pack_expansion): New.
723 (tsubst_template_args): Handle substitutions of argument packs and
724 pack expansion into template argument lists.
725 (tsubst_decl): Expand function parameter packs into separate
727 (tsubst_arg_types): Expand a type pack expansion into separate
729 (tsubst_exception_specification): Handle pack expansions in
730 exception specifiers.
731 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
732 replacing a template parameter with its argument. If we encounter
733 a substitution for an argument pack, just return the parameter
735 (tsubst_copy): sizeof(X...) returns the number of elements in
736 parameter pack X. See through ARGUMENT_PACK_SELECT when the
737 PARM_DECL is a parameter pack.
738 (tsubst_expr): Expression pack expansions and argument packs
739 cannot show up here; they will all be handled through function
740 calls, sizeof, and template argument lists.
741 (tsubst_copy_and_build): sizeof(X...) returns the number of
742 elements in parameter pack X. Handle pack expansions in TREE_LIST
743 and CONSTRUCTOR nodes.
744 (fn_type_unification): Handle "incomplete" explicit template
745 argument lists that specify some of the arguments for a template
747 (type_unification_real): Unify arguments against pack expansions.
748 (template_parm_level_and_index): New, helper function.
749 (unify_pack_expansion): New.
750 (unify): Unify argument packs on an argument-by-argument basis,
751 handling variadic argument packs as well.
752 (more_specialized_fn): Handle unification of function parameter
753 packs. All things being equal, prefer non-variadic function
754 templates to variadic function templates.
755 (more_specialized_class): Prefer the variadic class template
756 partial specialization that binds fewer arguments to a parameter
758 (regenerate_decl_from_template): Expand function parameter packs
759 into separate parameters.
760 (instantiate_decl): Ditto.
761 (tsubst_initializer_list): Handle pack expansions for base-class
763 (dependent_type_p_r): Determine dependent types in argument packs
765 (value_dependent_expression_p): Determine value-dependence of
766 non-type argument packs.
767 (dependent_template_arg_p): Handle argument packs.
768 * semantics.c (finish_cond): Check for bare parameter packs.
769 (finish_expr_stmt): Ditto.
770 (finish_for_expr): Ditto.
771 (finish_switch_cond): Ditto.
772 (finish_mem_initializers): Ditto.
773 * name-lookup.c (arg_assoc_type): Handle pack expansions and
775 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
776 * parser.c (make_declarator): Declarator is not an expansion.
777 (make_pointer_declarator): Transfer parameter pack flag to outer
779 (make_reference_declarator): Ditto.
780 (make_ptrmem_declarator): Ditto.
781 (make_call_declarator): Ditto.
782 (make_array_declarator): Ditto.
783 (cp_parser_postfix_expression): Allow pack expansion expressions
784 in the argument list for a call expression.
785 (cp_parser_parenthesized_expression_list): Add new parameter
786 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
787 into separate arguments."
788 (cp_parser_new_placement): Allow pack expansion expressions.
789 (cp_parser_new_initializer): Ditto.
790 (cp_parser_mem_initializer_list): Allow ellipsis to create a
791 base-class initializer expansion.
792 (cp_parser_mem_initializer): Ditto.
793 (cp_parser_template_parameter_list): Keep track of whether the
794 template parameter is a template parameter pack.
795 (cp_parser_template_parameter): Parse the ellipsis to indicate a
796 template parameter pack.
797 (cp_parser_type_parameter): Ditto.
798 (cp_parser_template_argument_list): Parse the ellipsis to indicate
800 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
801 this declarator is a parameter pack.
802 (cp_parser_parameter_declaration): The ellipsis does not end the
803 parameter declaration, because it might be a parameter pack. Parse
804 the ellipsis to indicate a parameter pack.
805 (cp_parser_initializer): Allow pack expansions.
806 (cp_parser_initializer_list): Allow ellipsis to create an
807 initializer expansion.
808 (cp_parser_base_clause): Allow ellipsis to create a base specifier
810 (cp_parser_type_id_list): Allow ellipsis to create an exception
812 (cp_parser_attribute_list): Don't allow pack expansions.
813 (cp_parser_functional_cast): Allow pack expansions.
814 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
815 compute the length of a parameter pack.
816 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
817 end a template argument.
818 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
819 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
822 2007-03-09 Dirk Mueller <dmueller@suse.de>
824 * cp/call.c (build_new_op): Call warn_logical_operator.
826 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
829 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
832 * pt.c (any_template_arguments_need_structural_equality_p):
835 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
837 * decl.c (grokdeclarator): Disable warnings for anonymous
840 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
842 * typeck2.c (readonly_error): Always emit a hard error.
843 Remove last argument.
844 * cp-tree.h (readonly_error): Adjust prototype.
845 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
846 * typeck.c (build_unary_op): Likewise.
847 (build_modify_expr): Likewise.
849 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
852 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
854 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
857 * parser.c (struct cp_parser): New IN_IF_STMT.
858 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
859 returning if parsing the body of an 'if' statement or issuing an
860 error and continuing.
861 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
863 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
865 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
868 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
871 2007-03-02 Geoffrey Keating <geoffk@apple.com>
873 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
874 Objective-C++. Don't exit early if -shared-libgcc needs to be
877 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
879 * typeck.c (common_base_type): Delete unused function.
881 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
883 * Make-lang.in: Add dummy lang.install-pdf target.
885 2007-03-01 Simon Baldwin <simonb@google.com>
888 * decl.c (check_tag_decl): Added new warning for typedef ignored
889 when it precedes an otherwise valid non-typedef declaration.
891 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
893 * typeck.c (build_function_call): Store converted arguments
894 in a stack-allocated array instead of building a list.
895 (convert_arguments): Store arguments in the array passed in as an
896 argument, and return the actual number of arguments.
897 * call.c (build_call): Delete, and replace with...
898 (build_call_n, build_call_a): New.
899 (build_op_delete_call): Rewrite to avoid constructing argument lists.
900 (build_over_call): Store converted arguments in a stack-allocated
901 array instead of building a list.
902 (build_cxx_call): Pass arguments in an array instead of as a list.
903 (build_java_interface_fn_ref): Rewrite to avoid constructing
905 * tree.h: Update declarations to reflect above changes.
906 * method.c (use_thunk): Use a stack-allocated array to hold
907 the arguments instead of a list.
908 * rtti.c (throw_bad_cast): Update call to cxx_call.
909 (throw_bad_typeid): Likewise.
910 (build_dynamic_cast_1): Likewise.
911 * init.c (build_builtin_delete_call): Use build_call_n.
912 * decl.c (expand_static_init): Likewise.
913 * except.c (cp_protect_cleanup_actions): Likewise.
914 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
915 (gimplify_must_not_throw_expr): Likewise.
916 (cxx_omp_apply_fn): Use build_call_a.
918 2007-02-26 Mark Mitchell <mark@codesourcery.com>
920 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
921 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
923 2007-02-25 Mark Mitchell <mark@codesourcery.com>
925 * cp-tree.h (static_ctors): Remove.
926 * cp-tree.h (static_dtors): Likewise.
927 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
928 refactoring of tree_map hierarchy.
929 (decl_shadowed_for_var_insert): Likewise.
930 * semantics.c (expand_body): Use c_expand_body.
931 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
932 * decl2.c (static_ctors): Remove.
933 (static_dtors): Likewise.
934 (generate_ctor_or_dtor_function): Pass NULL_TREE to
935 objc_generate_static_init_call. Do not call static_[cd]tors.
936 (generate_ctor_and_dtor_functions_for_priority): Do not check for
938 (cp_write_global_declarations): Likewise.
940 2007-02-23 Richard Guenther <rguenther@suse.de>
942 * class.c (note_name_declared_in_class): Make declaration
943 changes meaning a pedwarn.
945 2007-02-22 Michael Matz <matz@suse.de>
948 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
949 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
950 dump_function_decl): Guard emitting outer scopes by new flag.
951 * cp-lang.c (cxx_dwarf_name): New function.
952 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
953 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
955 (push_template_decl_real, lookup_template_class): Remove calls
958 2007-02-19 Mark Mitchell <mark@codesourcery.com>
960 * call.c (build_new_method_call): Ensure that explicit calls of
961 destructors have type "void".
963 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
965 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
966 and -Walways-true with -Waddress.
967 * cvt.c (convert_to_void): Replace unconditional warning with
970 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
972 * decl.c, tree.c: Fix comment typos.
974 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
977 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
978 statement expression if we had an error mark node.
980 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
981 Brooks Moses <brooks.moses@codesourcery.com>
982 Lee Millward <lee.millward@codesourcery.com>
984 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
985 Change class to tcc_vl_exp.
987 * call.c (build_call): Use build_call_list instead
989 (build_over_call): Likewise.
990 (build_new_method_call): Use build_min_non_dep_call_list
991 instead of build_min_non_dep.
993 * error.c (dump_call_expr_args): New function.
994 (dump_aggr_init_expr_args): New function.
995 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
996 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
998 * cvt.c (convert_to_void): Use build_call_array instead
999 of build3; use new AGGR_INIT_EXPR accessor macros.
1001 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1002 instead of TREE_CODE_LENGTH.
1004 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1005 AGGR_INIT_EXPR accessor macros.
1007 * cp-gimplify.c (cp_gimplify_init_expr): Use
1008 AGGR_INIT_EXPR_SLOT to set the slot operand.
1010 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1011 (AGGR_INIT_EXPR_SLOT): New macro.
1012 (AGGR_INIT_EXPR_ARG): New macro.
1013 (aggr_init_expr_nargs): New macro.
1014 (AGGR_INIT_EXPR_ARGP): New macro.
1015 (aggr_init_expr_arg_iterator): New.
1016 (init_aggr_init_expr_arg_iterator): New.
1017 (next_aggr_init_expr_arg): New.
1018 (first_aggr_init_expr_arg): New.
1019 (more_aggr_init_expr_args_p): New.
1020 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1021 (stabilize_aggr_init): New declaration.
1022 (build_min_non_dep_call_list): Likewise.
1024 * tree.c (process_aggr_init_operands): New function.
1025 (build_aggr_init_array) New function.
1026 (build_cplus_new): Update to use new CALL_EXPR and
1027 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1028 build_aggr_init_array.
1029 (build_min_non_dep_call_list) New function.
1030 (build_min_nt): Assert input code parameter is not a variable
1031 length expression class.
1032 (build_min, build_min_non_dep): Likewise.
1033 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1034 to check for equality instead of recursing. Handle tcc_vl_exp
1036 (stabilize_call): Update to only handle CALL_EXPRs, not
1037 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1038 (stabilize_aggr_init): New function.
1039 (stabilize_init): Use it.
1041 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1042 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1043 AGGR_INIT_EXPR accessor macros and argument iterators.
1045 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1046 build_vl_exp. Iterate through the operands, recursively
1047 processing each one.
1048 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1049 CALL_EXPR accessor macros.
1050 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1051 tree code classes. Use TREE_OPERAND_LENGTH instead of
1054 * semantics.c (finish_call_expr): Use build_nt_call_list
1055 instead of build_nt.
1056 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1057 accessor macros. Use build_call_array to construct the
1058 CALL_EXPR node instead of build3
1060 * decl2.c (build_offset_ref_call_from_tree): Use
1061 build_nt_call_list and build_min_non_dep_call_list instead
1062 of build_min_nt and build_min_non_dep.
1064 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1065 Use build_nt_call_list instead of build_min_nt.
1067 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1070 * call.c (build_conditional_expr): Improve error message.
1072 2007-02-13 Dirk Mueller <dmueller@suse.de>
1074 * friend.c (do_friend): Annotate warning about friend
1075 declarations in templates with OPT_Wnon_template_friend.
1076 Convert informal message from warning() to inform().
1078 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1079 Mark Mitchell <mark@codesourcery.com>
1082 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1083 instantiations for variables.
1085 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1088 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1089 Check warn_unused_value just once.
1091 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1094 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1095 (fn_type_unificiation): Likewise.
1096 (get_bindings): Likewise.
1098 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1101 * decl.c (finish_function): Use DECL_REPLACEABLE.
1102 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1104 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1106 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1108 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1110 * decl.c (grokvardecl): Don't error if !have_tls.
1111 (grokdeclarator): Likewise.
1112 * parser.c (cp_parser_omp_threadprivate): Likewise.
1114 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1117 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1118 parameters and result decls in omp clauses.
1119 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1122 2007-02-05 Dirk Mueller <dmueller@suse.de>
1125 * parser.c (cp_parser_class_specifier): Always initialize bases.
1127 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1129 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1130 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1131 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1133 * semantics.c (finish_omp_atomic): Store a whole expression node
1134 in operand 1, and integer_zero_node in operand 0, for dependent
1135 OMP_ATOMIC. Rewrite to make flow easier to understand.
1137 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1139 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1141 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1143 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1144 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1146 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1148 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1149 keyword warning to -Wc++0x-compat.
1151 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1153 * decl.c (grokdeclarator): Update documentation.
1155 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1158 * decl.c (grokdeclarator): If __thread is used together with
1159 a storage class other than extern and static, clear thread_p
1160 after issuing diagnostics and fall through to checking the
1163 2007-01-30 Roger Sayle <roger@eyesopen.com>
1165 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1166 calculating the size of an array (to avoid recursive errors).
1168 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1171 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1173 * call.c (convert_like_real): Don't warn when converting to
1176 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1178 * decl.c (pop_label): Replace warning with call to
1179 warn_for_unused_label.
1181 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1184 * semantics.c (finish_pseudo_destructor_expr): Check the
1185 destrutor name by calling check_dtor_name.
1187 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1189 * lex.c (D_CPP0X): Rename.
1191 (reswords): D_CPP0X -> D_CXX0X.
1192 (init_reswords): Ditto.
1193 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1194 of C++0x keywords as identifiers.
1196 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1199 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1202 2007-01-23 Ian Lance Taylor <iant@google.com>
1204 * typeck.c (convert_for_assignment): Only warn about a = b = c
1205 when converting to bool.
1207 2007-01-23 Roger Sayle <roger@eyesopen.com>
1209 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1211 * typeck.c (ignore_overflows): Remove the remaining uses of
1212 TREE_CONSTANT_OVERFLOW.
1214 2007-01-20 Jan Hubicka <jh@suse.cz>
1216 * decl2.c (start_objects, start_static_storage_duration_function):
1217 Do not make the functions uninlinable.
1219 2007-01-17 Ian Lance Taylor <iant@google.com>
1221 * class.c (add_method): Call VEC_reserve_exact rather than passing
1222 a negative size to VEC_reserve.
1224 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1227 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1229 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1232 * decl.c (make_typename_type): If the qualified name is not a
1233 type, issue an error.
1234 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1237 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1239 * rtti.c: Include target.h.
1240 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1241 don't emit typeinfo for fundamental types as weak.
1242 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1244 2007-01-08 Richard Guenther <rguenther@suse.de>
1246 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1248 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1250 * call.c (standard_conversion): Pass flag to
1251 vector_types_convertible_p to disallow emission of note.
1252 * typeck.c (convert_for_assignment): Pass flag to
1253 vector_types_convertible_p to allow emission of note.
1254 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1255 to disallow emission of note.
1257 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1260 * typeck.c (build_binary_op): Call overflow_warning if
1261 TREE_OVERFLOW_P is true for the result and not for any of the
1264 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1267 * class.c (add_method): Don't wait until template
1268 instantiation time to complain about duplicate methods.
1270 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1273 * semantics.c (finish_unary_op_expr): Warn only if result
1274 overflowed and operands did not.
1276 2007-01-05 Ian Lance Taylor <iant@google.com>
1278 * typeck.c (build_binary_op): Warn about comparing a non-weak
1281 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1283 * pt.c (tsubst): Propagate the need for structural equality checks
1284 when reducing the level of template parameters.
1286 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1288 * pt.c: Fix a comment typo.
1290 2007-01-02 Ian Lance Taylor <iant@google.com>
1292 * semantics.c (maybe_convert_cond): Optionally warn when using an
1293 assignment as a condition.
1294 * typeck.c (convert_for_assignment): Optionally warn about
1295 assigning the result of an assignment to a bool.
1297 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1299 * pt.c (canonical_template_parms): Correct typo in comment.
1301 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1303 * typeck.c (structural_comptypes): Renamed from "comptypes".
1304 (comptypes): Use canonical type information to perform fast type
1305 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1306 canonical type comparison returns the same results as we would see
1307 from the current, structural check. Support COMPARE_STRUCTURAL
1308 when we need structural checks.
1309 * decl.c (typename_compare): Fix comment.
1310 (build_typename_type): TYPENAME_TYPE nodes require structural
1311 equality checks, because they resolve different based on the
1313 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1314 require structural equality checks (for now).
1315 (build_ptrmemfunc_type): Build the canonical pointer to member
1317 (compute_array_index_type): Whenever we build a new index type
1318 to represent the size of an array in a template, we need to mark
1319 this index type as requiring structural equality. This goes for
1320 arrays with value-dependent sizes with the current ABI, or all
1322 * tree.c (cplus_array_hash): New.
1323 (struct cplus_array_info): New.
1324 (cplus_array_compare): New.
1325 (cplus_array_htab): New.
1326 (build_cplus_array_type_1): Use a hash table to cache the array
1327 types we build. Build the canonical array type for each array
1329 (cp_build_qualified_type_real): When building a cv-qualified array
1330 type, use the hash table of array types and build canonical array
1332 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1333 use structural equality (for now).
1334 * cp-tree.h (COMPARE_STRUCTURAL): New.
1335 * pt.c (canonical_template_parms): New.
1336 (canonical_type_parameter): New.
1337 (process_template_parm): Find the canonical type parameter.
1338 (lookup_template_class): When we have named the primary template
1339 type, set the canonical type for our template class to the primary
1340 template type. If any of the template arguments need structural
1341 equality checks, the template class needs structural equality
1343 (tsubst): When reducing the level of a template template
1344 parameter, we require structural equality tests for the resulting
1345 parameter because its template parameters have not had their types
1346 canonicalized. When reducing a template type parameter, find the
1347 canonical reduced type parameter.
1348 (any_template_arguments_need_structural_equality_p): New.