1 2007-05-04 Dirk Mueller <dmueller@suse.de>
3 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
6 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
9 * decl2.c (constrain_class_visibility):
10 Use strip_pointer_or_array_types instead of strip_array_types.
12 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
15 * decl.c (reshape_init_r): Don't reshape the first element if it
16 is a pointer to member function.
18 2007-04-27 Simon Baldwin <simonb@google.com>
20 * decl.c (grokparms): Changed message format from %qD to %qE.
22 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
24 * error.c (maybe_warn_variadic_templates): Variadic templates are
25 now in C++0x, so only warn about them in C++98 mode.
27 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
30 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
31 integeral types from vectors types.
33 2007-04-26 Jakub Jelinek <jakub@redhat.com>
36 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
37 for type dependent OMP_CLAUSE_DECLs.
39 2007-04-24 Mark Mitchell <mark@codesourcery.com>
42 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
43 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
44 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
45 * init.c (build_zero_init): Adjust, as
46 COMPLEX_TYPE is now a SCALAR_TYPE.
47 * typeck2.c (digest_init): Allow brace-enclosed initializers for
48 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
50 2007-04-25 Paolo Carlini <pcarlini@suse.de>
52 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
53 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
54 (trait_expr_value): Adjust.
56 2007-04-23 Simon Baldwin <simonb@google.com>
58 * decl.c (grokparms): Added new error for duplicate function
59 parameters names in function prototypes, to match gcc behavior.
61 2007-04-23 Jan Hubicka <jh@suse.cz>
63 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
66 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
68 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
69 instead of checking GIMPLE_STMT_P in chain_next.
71 2007-04-17 Mark Mitchell <mark@codesourcery.com>
74 * call.c (convert_for_arg_passing): Convert bitfields to their
77 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
80 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
82 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
86 * cp/decl2.c (constrain_class_visibility):
87 Do not warn about the use of anonymous namespace in the main input file.
89 2007-04-15 Mark Mitchell <mark@codesourcery.com>
91 * cp-tree.h (current_template_parms): Fix typo in comment.
93 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
95 * cp-tree.h, error.c: Fix comment typos.
97 2007-04-13 Jason Merrill <jason@redhat.com>
100 * call.c (reference_binding): Add c_cast_p parm. If true,
101 add quals to TO as needed to make it reference-compatible.
103 2007-04-11 Jan Hubicka <jh@suse.cz>
105 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
106 that we are not processing template_decl.
108 2007-04-09 Mark Mitchell <mark@codesourcery.com>
111 * class.c (build_base_path): Ensure that the converted pointer has
112 the same cv-qualification as the input.
114 2007-04-09 Paolo Carlini <pcarlini@suse.de>
116 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
118 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
120 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
122 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
123 * tree.c (cp_add_pending_fn_decls): Remove.
124 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
126 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
128 Revert change removing staticp.
130 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
132 * cp-objcp-common.c (cxx_staticp): Remove.
133 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
134 * cp-tree.h (cxx_staticp):
136 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
138 * class.c (check_for_override): Don't remove dllmport attribute
141 2007-04-03 Jakub Jelinek <jakub@redhat.com>
144 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
145 type issue error and return early.
147 2007-03-30 Jason Merrill <jason@redhat.com>
150 * typeck.c (cp_type_readonly): New fn.
151 * cp-tree.h: Declare it.
152 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
153 (cp_finish_decl): Not here.
155 2007-03-31 Richard Guenther <rguenther@suse.de>
157 * optimize.c (maybe_clone_body): Replace splay-tree usage by
160 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
165 * parser.c (declarator_can_be_parameter_pack): New.
166 (cp_parser_template_parameter): Only parse the `...' if the
167 declarator can be a parameter pack.
168 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
170 * pt.c (find_parameter_packs_r): Look into the bounds on integer
171 types (they could be used as array bounds).
172 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
173 (tsubst_pack_expansion): Handle failure to expand parameter
176 2007-03-30 Paolo Carlini <pcarlini@suse.de>
179 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
180 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
181 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
182 (CLASS_TYPE_NON_UNION_P): Add.
183 (struct lang_type_class): Add has_complex_dflt.
184 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
185 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
186 * cp-tree.def: Add TRAIT_EXPR.
187 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
188 * lex.c (struct resword): Add __has_nothrow_assign,
189 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
190 __has_trivial_constructor, __has_trivial_copy,
191 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
192 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
193 __is_pod, __is_polymorphic, __is_union.
194 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
195 (cp_parser_trait_expr): New.
196 * semantics.c (finish_trait_expr, trait_expr_value
197 classtype_has_nothrow_copy_or_assign_p): New.
198 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
200 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
201 * class.c (check_bases, check_field_decl, check_bases_and_members):
202 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
203 * pt.c (uses_template_parms, tsubst_copy_and_build,
204 value_dependent_expression_p, type_dependent_expression_p): Deal with
206 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
208 2007-03-29 Richard Guenther <rguenther@suse.de>
210 * tree.c (cp_walk_subtrees): Do not set input_location.
212 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
215 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
218 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
220 * parser.c (struct cp_parser): Update comment for
221 greater_than_is_operator_p.
222 (cp_parser_primary_expression): In C++0x mode, a cast operator can
223 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
224 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
225 !GREATER_THAN_IS_OPERATOR_P.
226 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
227 `>>' operators that will become two `>' tokens in C++0x.
228 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
229 mode, allowing it to terminate default arguments.
230 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
231 `>>' like two consecutive `>' tokens.
232 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
233 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
234 ends a template argument.
236 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
238 * decl.c (redeclaration_error_message): Complain when redeclaring
239 a friend function with default template arguments (C++0x mode only).
240 * cp-tree.h (check_default_tmpl_args): Declare.
241 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
242 template arguments in function templates. Add support for checking
243 the default template arguments of friend templates.
244 (push_template_decl_real): Fix call to check_default_tmpl_args.
245 (type_unification_real): If a template parameter has not been
246 deduced but provides a default template argument, substitute into
247 that default template argument.
248 * parser.c (cp_parser_init_declarator): When declaring (but not
249 defining!) a function template in C++0x mode, check for default
252 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
255 * decl.c (grokdeclarator): Deal with cv-qualified function type
256 typedefs in the same way for member and non-member functions.
258 2007-03-26 Dirk Mueller <dmueller@suse.de>
260 * parser.c (cp_parser_member_declaration): Pedwarn
261 about stray semicolons after member declarations.
263 2007-03-26 Paolo Carlini <pcarlini@suse.de>
266 * pt.c (instantiate_decl): Set in_system_header.
268 2007-03-22 Mark Mitchell <mark@codesourcery.com>
270 * cp-tree.h (current_tempalte_parms): Improve documentation.
271 * pt.c (current_template_args): Likewise.
274 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
275 not consume tokens when failing.
277 2007-03-22 Jim Wilson <wilson@specifix.com>
278 Mark Mitchell <mark@codesourcery.com>
281 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
282 consistent with FROM.
284 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
286 * error.c (dump_expr): Handle dependent names that designate types.
287 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
289 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
291 * cp-tree.def, parser.c, pt.c: Fix comment typos.
293 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
295 * cvt.c (cp_convert_and_check) : Define.
296 * cp-tree.h (cp_convert_and_check): Declare.
297 * call.c (convert_conversion_warnings): Rename to
298 conversion_null_warnings. The warning for floating-point to
299 integer is handled by convert_and_check in convert_like_real.
300 (convert_like_real): convert_conversion_warnings was renamed as
301 conversion_null_warnings.
302 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
303 overflow and changes of value during conversion.
305 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
308 * parser.c (cp_parser_statement): If 'namespace' is found, this
309 only can be a namespace alias definition, so parse it now.
310 (cp_parser_namespace_alias_definition): if we find an open brace
311 instead of '=', then this is actually a misplaced namespace
314 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
317 * decl.c (cxx_init_decl_processing): Move command-line options
318 processing to c-opts.c.
320 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
322 * ptree.c (cxx_print_type): Use formatting markup for integers
323 when printing template parameter index/level/orig level.
324 (cxx_print_xnode): Ditto.
325 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
326 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
327 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
329 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
330 rather than a HOST_WIDE_INT.
331 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
332 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
334 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
335 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
336 IN_BASE_INITIALIZER bool bitfields.
337 (struct cp_declarator): Make KIND a 4-bit field. Make
338 PARAMETER_PACK_P a bool bitfield just after KIND.
339 * pt.c (uses_parameter_packs): Destroy the pointer set.
340 (make_pack_expansion): Ditto.
341 (check_for_bare_parameter_packs): Ditto.
342 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
344 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
347 * call.c (convert_default_arg): Instead of copying the node,
350 2007-03-15 Dirk Mueller <dmueller@suse.de>
353 * call.c (convert_conversion_warnings): New..
354 (convert_like_real): .. factored out from here.
355 (convert_conversion_warnings): Add warning about
356 false being converted to NULL in argument passing.
358 2007-03-14 Dirk Mueller <dmueller@suse.de>
360 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
361 (finish_do_body): Warn about empty body in do/while statement.
363 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
365 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
367 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
370 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
373 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
375 * cp/repo.c (init_repo): Initialize random_seed saved options.
376 (finish_repo): Adjust.
378 2007-03-13 Mark Mitchell <mark@codesourcery.com>
381 * Make-lang.in (doc/g++.1): Use $< to specify the location from
384 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
386 * decl.c (compute_array_index_type): New warning flag warn_vla.
388 2007-03-12 Mark Mitchell <mark@codesourcery.com>
391 * call.c (convert_default_arg): Copy non-constant arguments.
393 2007-03-11 Mark Mitchell <mark@codesourcery.com>
396 * parser.c (cp_parser_postfix_expression): Disallow compound
397 literals in constant expressions.
400 * semantics.c (finish_typeof): Use unlowered_expr_type.
402 2007-03-10 Mark Mitchell <mark@codesourcery.com>
405 * cp-tree.h (unlowered_expr_type): New function.
406 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
407 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
408 (unlowered_expr_type): New function.
409 (build_unary_op): Disallow predecrements of bool bitfields.
410 * call.c (build_conditional_expr): Use unlowered_expr_type.
411 * pt.c (type_unification_real): Likewise.
413 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
416 * typeck.c (check_return_expr): Check for bare parameter packs.
417 (comptypes): Compare template parameter packs and
418 type pack expansions.
419 * decl.c (grokdeclarator): Deal with the declaration of function
421 (grokparms): Verify that the (optional) function parameter pack is
422 at the end of the parameter list.
423 (xref_basetypes): Handle pack expansions in the base class.
424 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
425 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
426 (NONTYPE_ARGUMENT_PACK): New.
427 (TYPE_PACK_EXPANSION): New.
428 (EXPR_PACK_EXPANSION): New.
429 (ARGUMENT_PACK_SELECT): New.
430 * cp-objcp-common.c (cp_tree_size): Compute size of
431 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
432 ARGUMENT_PACK_SELECT.
433 * error.c (dump_template_argument): Print template argument packs.
434 (dump_template_argument_list): Ditto.
435 (dump_template_parameter): Dump `...' for template type parameter
437 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
438 (dump_parameters): Print function parameter packs.
439 (dump_template_parms): Print template argument packs.
440 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
441 (maybe_warn_variadic_templates): New.
442 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
443 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
444 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
446 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
447 (write_template_arg): Write argument packs as separate arguments.
448 * cp-tree.h (struct template_parm_index_s): Add flag that
449 indicates that the template parameter is actually a parameter
451 (struct tree_argument_pack_select): New.
452 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
453 (union lang_tree_node): Add argument_pack_select.
454 (FUNCTION_PARAMETER_PACK_P): New.
455 (PACK_EXPANSION_P): New.
456 (PACK_EXPANSION_PATTERN): New.
457 (SET_PACK_EXPANSION_PATTERN): New.
458 (PACK_EXPANSION_PARAMETER_PACKS): New.
459 (ARGUMENT_PACK_P): New.
460 (ARGUMENT_PACK_ARGS): New.
461 (SET_ARGUMENT_PACK_ARGS): New.
462 (ARGUMENT_PACK_INCOMPLETE_P): New.
463 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
464 (TEMPLATE_PARM_PARAMETER_PACK): New.
465 (TEMPLATE_TYPE_PARAMETER_PACK): New.
466 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
467 (ARGUMENT_PACK_SELECT_INDEX): New.
468 (ARGUMENT_PACK_SELECT_ARG): New.
469 (struct cp_declarator): Add parameter_pack_p flag.
470 (maybe_warn_variadic_templates): Declare.
471 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
472 indicate a template parameter pack.
473 (uses_parameter_packs): Declare.
474 (template_parameter_pack_p): Declare.
475 (template_parms_variadic_p): Declare.
476 (make_pack_expansion): Declare.
477 (check_for_bare_parameter_packs): Declare.
478 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
479 sizeof... expressions.
480 (pp_cxx_expression): Print pack expansions and non-type argument
482 (pp_cxx_exception_specification): Print pack expansions.
483 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
484 (pp_cxx_ctor_initializer): Print pack expansions.
485 (pp_cxx_type_id): Print pack expansions.
486 (pp_cxx_template_argument_list): Print argument packs.
487 (pp_cxx_template_parameter): Print ellipsis for template parameter
489 * pt.c (comp_template_parms): Compare template parameter packs.
490 (template_parameter_pack_p): New.
491 (template_parms_variadic_p): New.
492 (template_args_variadic_p): New.
493 (make_ith_pack_parameter_name): New.
494 (struct find_parameter_pack_data): New.
495 (find_parameter_packs_r): New.
496 (uses_parameter_packs): New.
497 (make_pack_expansion): New.
498 (check_for_bare_parameter_packs): New.
499 (expand_template_argument_pack): New.
500 (reduce_template_parm_level): Propagate parameter pack flag.
501 (process_template_parm): Add is_parameter_pack parameter to state
502 when the parameter is actually a parameter pack. Create template
503 parameter packs when is_parameter_pack is true.
504 (current_template_args): The argument for a template parameter
505 pack is an argument pack containing a single pack expansion.
506 (process_partial_specialization): When checking that non-type
507 argument expressions do not involve template parameters, loop over
508 the arguments in argument packs separately.
509 (push_template_decl_real): Check that the type of the declaration
510 does not have any bare parameter packs. Check that primary
511 templates have no more than one parameter pack, and that it comes
512 at the end of the template parameter list.
513 (convert_template_argument): Handle coercions for pack expansion
514 expressions by coercing the pattern then rebuilding the expansion.
515 (coerce_template_parms): When coercing the arguments for a
516 variadic template, pack "extra" arguments into an argument pack.
517 (coerce_template_template_parms): Cannot coerce between parameter
518 packs and non-pack parameters.
519 (template_args_equal): Compare PACK_EXPANSION_P expressions.
520 (comp_template_args): Expand all template arguments packs before
521 comparing template argument lists.
522 (mangle_class_name_for_template): Make argument packs as separate
524 (for_each_template_parm_r): No need to handle BASELINK.
525 (instantiate_class_template): Handle pack expansions in the base
527 (tsubst_pack_expansion): New.
528 (tsubst_template_args): Handle substitutions of argument packs and
529 pack expansion into template argument lists.
530 (tsubst_decl): Expand function parameter packs into separate
532 (tsubst_arg_types): Expand a type pack expansion into separate
534 (tsubst_exception_specification): Handle pack expansions in
535 exception specifiers.
536 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
537 replacing a template parameter with its argument. If we encounter
538 a substitution for an argument pack, just return the parameter
540 (tsubst_copy): sizeof(X...) returns the number of elements in
541 parameter pack X. See through ARGUMENT_PACK_SELECT when the
542 PARM_DECL is a parameter pack.
543 (tsubst_expr): Expression pack expansions and argument packs
544 cannot show up here; they will all be handled through function
545 calls, sizeof, and template argument lists.
546 (tsubst_copy_and_build): sizeof(X...) returns the number of
547 elements in parameter pack X. Handle pack expansions in TREE_LIST
548 and CONSTRUCTOR nodes.
549 (fn_type_unification): Handle "incomplete" explicit template
550 argument lists that specify some of the arguments for a template
552 (type_unification_real): Unify arguments against pack expansions.
553 (template_parm_level_and_index): New, helper function.
554 (unify_pack_expansion): New.
555 (unify): Unify argument packs on an argument-by-argument basis,
556 handling variadic argument packs as well.
557 (more_specialized_fn): Handle unification of function parameter
558 packs. All things being equal, prefer non-variadic function
559 templates to variadic function templates.
560 (more_specialized_class): Prefer the variadic class template
561 partial specialization that binds fewer arguments to a parameter
563 (regenerate_decl_from_template): Expand function parameter packs
564 into separate parameters.
565 (instantiate_decl): Ditto.
566 (tsubst_initializer_list): Handle pack expansions for base-class
568 (dependent_type_p_r): Determine dependent types in argument packs
570 (value_dependent_expression_p): Determine value-dependence of
571 non-type argument packs.
572 (dependent_template_arg_p): Handle argument packs.
573 * semantics.c (finish_cond): Check for bare parameter packs.
574 (finish_expr_stmt): Ditto.
575 (finish_for_expr): Ditto.
576 (finish_switch_cond): Ditto.
577 (finish_mem_initializers): Ditto.
578 * name-lookup.c (arg_assoc_type): Handle pack expansions and
580 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
581 * parser.c (make_declarator): Declarator is not an expansion.
582 (make_pointer_declarator): Transfer parameter pack flag to outer
584 (make_reference_declarator): Ditto.
585 (make_ptrmem_declarator): Ditto.
586 (make_call_declarator): Ditto.
587 (make_array_declarator): Ditto.
588 (cp_parser_postfix_expression): Allow pack expansion expressions
589 in the argument list for a call expression.
590 (cp_parser_parenthesized_expression_list): Add new parameter
591 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
592 into separate arguments."
593 (cp_parser_new_placement): Allow pack expansion expressions.
594 (cp_parser_new_initializer): Ditto.
595 (cp_parser_mem_initializer_list): Allow ellipsis to create a
596 base-class initializer expansion.
597 (cp_parser_mem_initializer): Ditto.
598 (cp_parser_template_parameter_list): Keep track of whether the
599 template parameter is a template parameter pack.
600 (cp_parser_template_parameter): Parse the ellipsis to indicate a
601 template parameter pack.
602 (cp_parser_type_parameter): Ditto.
603 (cp_parser_template_argument_list): Parse the ellipsis to indicate
605 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
606 this declarator is a parameter pack.
607 (cp_parser_parameter_declaration): The ellipsis does not end the
608 parameter declaration, because it might be a parameter pack. Parse
609 the ellipsis to indicate a parameter pack.
610 (cp_parser_initializer): Allow pack expansions.
611 (cp_parser_initializer_list): Allow ellipsis to create an
612 initializer expansion.
613 (cp_parser_base_clause): Allow ellipsis to create a base specifier
615 (cp_parser_type_id_list): Allow ellipsis to create an exception
617 (cp_parser_attribute_list): Don't allow pack expansions.
618 (cp_parser_functional_cast): Allow pack expansions.
619 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
620 compute the length of a parameter pack.
621 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
622 end a template argument.
623 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
624 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
627 2007-03-09 Dirk Mueller <dmueller@suse.de>
629 * cp/call.c (build_new_op): Call warn_logical_operator.
631 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
634 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
637 * pt.c (any_template_arguments_need_structural_equality_p):
640 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
642 * decl.c (grokdeclarator): Disable warnings for anonymous
645 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
647 * typeck2.c (readonly_error): Always emit a hard error.
648 Remove last argument.
649 * cp-tree.h (readonly_error): Adjust prototype.
650 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
651 * typeck.c (build_unary_op): Likewise.
652 (build_modify_expr): Likewise.
654 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
657 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
659 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
662 * parser.c (struct cp_parser): New IN_IF_STMT.
663 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
664 returning if parsing the body of an 'if' statement or issuing an
665 error and continuing.
666 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
668 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
670 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
673 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
676 2007-03-02 Geoffrey Keating <geoffk@apple.com>
678 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
679 Objective-C++. Don't exit early if -shared-libgcc needs to be
682 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
684 * typeck.c (common_base_type): Delete unused function.
686 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
688 * Make-lang.in: Add dummy lang.install-pdf target.
690 2007-03-01 Simon Baldwin <simonb@google.com>
693 * decl.c (check_tag_decl): Added new warning for typedef ignored
694 when it precedes an otherwise valid non-typedef declaration.
696 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
698 * typeck.c (build_function_call): Store converted arguments
699 in a stack-allocated array instead of building a list.
700 (convert_arguments): Store arguments in the array passed in as an
701 argument, and return the actual number of arguments.
702 * call.c (build_call): Delete, and replace with...
703 (build_call_n, build_call_a): New.
704 (build_op_delete_call): Rewrite to avoid constructing argument lists.
705 (build_over_call): Store converted arguments in a stack-allocated
706 array instead of building a list.
707 (build_cxx_call): Pass arguments in an array instead of as a list.
708 (build_java_interface_fn_ref): Rewrite to avoid constructing
710 * tree.h: Update declarations to reflect above changes.
711 * method.c (use_thunk): Use a stack-allocated array to hold
712 the arguments instead of a list.
713 * rtti.c (throw_bad_cast): Update call to cxx_call.
714 (throw_bad_typeid): Likewise.
715 (build_dynamic_cast_1): Likewise.
716 * init.c (build_builtin_delete_call): Use build_call_n.
717 * decl.c (expand_static_init): Likewise.
718 * except.c (cp_protect_cleanup_actions): Likewise.
719 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
720 (gimplify_must_not_throw_expr): Likewise.
721 (cxx_omp_apply_fn): Use build_call_a.
723 2007-02-26 Mark Mitchell <mark@codesourcery.com>
725 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
726 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
728 2007-02-25 Mark Mitchell <mark@codesourcery.com>
730 * cp-tree.h (static_ctors): Remove.
731 * cp-tree.h (static_dtors): Likewise.
732 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
733 refactoring of tree_map hierarchy.
734 (decl_shadowed_for_var_insert): Likewise.
735 * semantics.c (expand_body): Use c_expand_body.
736 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
737 * decl2.c (static_ctors): Remove.
738 (static_dtors): Likewise.
739 (generate_ctor_or_dtor_function): Pass NULL_TREE to
740 objc_generate_static_init_call. Do not call static_[cd]tors.
741 (generate_ctor_and_dtor_functions_for_priority): Do not check for
743 (cp_write_global_declarations): Likewise.
745 2007-02-23 Richard Guenther <rguenther@suse.de>
747 * class.c (note_name_declared_in_class): Make declaration
748 changes meaning a pedwarn.
750 2007-02-22 Michael Matz <matz@suse.de>
753 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
754 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
755 dump_function_decl): Guard emitting outer scopes by new flag.
756 * cp-lang.c (cxx_dwarf_name): New function.
757 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
758 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
760 (push_template_decl_real, lookup_template_class): Remove calls
763 2007-02-19 Mark Mitchell <mark@codesourcery.com>
765 * call.c (build_new_method_call): Ensure that explicit calls of
766 destructors have type "void".
768 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
770 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
771 and -Walways-true with -Waddress.
772 * cvt.c (convert_to_void): Replace unconditional warning with
775 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
777 * decl.c, tree.c: Fix comment typos.
779 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
782 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
783 statement expression if we had an error mark node.
785 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
786 Brooks Moses <brooks.moses@codesourcery.com>
787 Lee Millward <lee.millward@codesourcery.com>
789 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
790 Change class to tcc_vl_exp.
792 * call.c (build_call): Use build_call_list instead
794 (build_over_call): Likewise.
795 (build_new_method_call): Use build_min_non_dep_call_list
796 instead of build_min_non_dep.
798 * error.c (dump_call_expr_args): New function.
799 (dump_aggr_init_expr_args): New function.
800 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
801 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
803 * cvt.c (convert_to_void): Use build_call_array instead
804 of build3; use new AGGR_INIT_EXPR accessor macros.
806 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
807 instead of TREE_CODE_LENGTH.
809 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
810 AGGR_INIT_EXPR accessor macros.
812 * cp-gimplify.c (cp_gimplify_init_expr): Use
813 AGGR_INIT_EXPR_SLOT to set the slot operand.
815 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
816 (AGGR_INIT_EXPR_SLOT): New macro.
817 (AGGR_INIT_EXPR_ARG): New macro.
818 (aggr_init_expr_nargs): New macro.
819 (AGGR_INIT_EXPR_ARGP): New macro.
820 (aggr_init_expr_arg_iterator): New.
821 (init_aggr_init_expr_arg_iterator): New.
822 (next_aggr_init_expr_arg): New.
823 (first_aggr_init_expr_arg): New.
824 (more_aggr_init_expr_args_p): New.
825 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
826 (stabilize_aggr_init): New declaration.
827 (build_min_non_dep_call_list): Likewise.
829 * tree.c (process_aggr_init_operands): New function.
830 (build_aggr_init_array) New function.
831 (build_cplus_new): Update to use new CALL_EXPR and
832 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
833 build_aggr_init_array.
834 (build_min_non_dep_call_list) New function.
835 (build_min_nt): Assert input code parameter is not a variable
836 length expression class.
837 (build_min, build_min_non_dep): Likewise.
838 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
839 to check for equality instead of recursing. Handle tcc_vl_exp
841 (stabilize_call): Update to only handle CALL_EXPRs, not
842 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
843 (stabilize_aggr_init): New function.
844 (stabilize_init): Use it.
846 * cxx-pretty-print.c (pp_cxx_postfix_expression)
847 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
848 AGGR_INIT_EXPR accessor macros and argument iterators.
850 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
851 build_vl_exp. Iterate through the operands, recursively
853 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
854 CALL_EXPR accessor macros.
855 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
856 tree code classes. Use TREE_OPERAND_LENGTH instead of
859 * semantics.c (finish_call_expr): Use build_nt_call_list
861 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
862 accessor macros. Use build_call_array to construct the
863 CALL_EXPR node instead of build3
865 * decl2.c (build_offset_ref_call_from_tree): Use
866 build_nt_call_list and build_min_non_dep_call_list instead
867 of build_min_nt and build_min_non_dep.
869 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
870 Use build_nt_call_list instead of build_min_nt.
872 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
875 * call.c (build_conditional_expr): Improve error message.
877 2007-02-13 Dirk Mueller <dmueller@suse.de>
879 * friend.c (do_friend): Annotate warning about friend
880 declarations in templates with OPT_Wnon_template_friend.
881 Convert informal message from warning() to inform().
883 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
884 Mark Mitchell <mark@codesourcery.com>
887 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
888 instantiations for variables.
890 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
893 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
894 Check warn_unused_value just once.
896 2007-02-11 Mark Mitchell <mark@codesourcery.com>
899 * pt.c (determine_specialization): Use skip_artificial_parms_for.
900 (fn_type_unificiation): Likewise.
901 (get_bindings): Likewise.
903 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
906 * decl.c (finish_function): Use DECL_REPLACEABLE.
907 * tree.c (cp_cannot_inline_tree_fn): Likewise.
909 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
911 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
913 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
915 * decl.c (grokvardecl): Don't error if !have_tls.
916 (grokdeclarator): Likewise.
917 * parser.c (cp_parser_omp_threadprivate): Likewise.
919 2007-02-07 Jakub Jelinek <jakub@redhat.com>
922 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
923 parameters and result decls in omp clauses.
924 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
927 2007-02-05 Dirk Mueller <dmueller@suse.de>
930 * parser.c (cp_parser_class_specifier): Always initialize bases.
932 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
934 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
935 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
936 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
938 * semantics.c (finish_omp_atomic): Store a whole expression node
939 in operand 1, and integer_zero_node in operand 0, for dependent
940 OMP_ATOMIC. Rewrite to make flow easier to understand.
942 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
944 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
946 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
948 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
949 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
951 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
953 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
954 keyword warning to -Wc++0x-compat.
956 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
958 * decl.c (grokdeclarator): Update documentation.
960 2007-02-02 Jakub Jelinek <jakub@redhat.com>
963 * decl.c (grokdeclarator): If __thread is used together with
964 a storage class other than extern and static, clear thread_p
965 after issuing diagnostics and fall through to checking the
968 2007-01-30 Roger Sayle <roger@eyesopen.com>
970 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
971 calculating the size of an array (to avoid recursive errors).
973 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
976 * typeck.c (build_binary_op): Fix logic for warning. Move warning
978 * call.c (convert_like_real): Don't warn when converting to
981 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
983 * decl.c (pop_label): Replace warning with call to
984 warn_for_unused_label.
986 2007-01-28 Andrew Pinski <pinskia@gmail.com>
989 * semantics.c (finish_pseudo_destructor_expr): Check the
990 destrutor name by calling check_dtor_name.
992 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
994 * lex.c (D_CPP0X): Rename.
996 (reswords): D_CPP0X -> D_CXX0X.
997 (init_reswords): Ditto.
998 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
999 of C++0x keywords as identifiers.
1001 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1004 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1007 2007-01-23 Ian Lance Taylor <iant@google.com>
1009 * typeck.c (convert_for_assignment): Only warn about a = b = c
1010 when converting to bool.
1012 2007-01-23 Roger Sayle <roger@eyesopen.com>
1014 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1016 * typeck.c (ignore_overflows): Remove the remaining uses of
1017 TREE_CONSTANT_OVERFLOW.
1019 2007-01-20 Jan Hubicka <jh@suse.cz>
1021 * decl2.c (start_objects, start_static_storage_duration_function):
1022 Do not make the functions uninlinable.
1024 2007-01-17 Ian Lance Taylor <iant@google.com>
1026 * class.c (add_method): Call VEC_reserve_exact rather than passing
1027 a negative size to VEC_reserve.
1029 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1032 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1034 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1037 * decl.c (make_typename_type): If the qualified name is not a
1038 type, issue an error.
1039 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1042 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1044 * rtti.c: Include target.h.
1045 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1046 don't emit typeinfo for fundamental types as weak.
1047 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1049 2007-01-08 Richard Guenther <rguenther@suse.de>
1051 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1053 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1055 * call.c (standard_conversion): Pass flag to
1056 vector_types_convertible_p to disallow emission of note.
1057 * typeck.c (convert_for_assignment): Pass flag to
1058 vector_types_convertible_p to allow emission of note.
1059 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1060 to disallow emission of note.
1062 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1065 * typeck.c (build_binary_op): Call overflow_warning if
1066 TREE_OVERFLOW_P is true for the result and not for any of the
1069 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1072 * class.c (add_method): Don't wait until template
1073 instantiation time to complain about duplicate methods.
1075 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1078 * semantics.c (finish_unary_op_expr): Warn only if result
1079 overflowed and operands did not.
1081 2007-01-05 Ian Lance Taylor <iant@google.com>
1083 * typeck.c (build_binary_op): Warn about comparing a non-weak
1086 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1088 * pt.c (tsubst): Propagate the need for structural equality checks
1089 when reducing the level of template parameters.
1091 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1093 * pt.c: Fix a comment typo.
1095 2007-01-02 Ian Lance Taylor <iant@google.com>
1097 * semantics.c (maybe_convert_cond): Optionally warn when using an
1098 assignment as a condition.
1099 * typeck.c (convert_for_assignment): Optionally warn about
1100 assigning the result of an assignment to a bool.
1102 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1104 * pt.c (canonical_template_parms): Correct typo in comment.
1106 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1108 * typeck.c (structural_comptypes): Renamed from "comptypes".
1109 (comptypes): Use canonical type information to perform fast type
1110 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1111 canonical type comparison returns the same results as we would see
1112 from the current, structural check. Support COMPARE_STRUCTURAL
1113 when we need structural checks.
1114 * decl.c (typename_compare): Fix comment.
1115 (build_typename_type): TYPENAME_TYPE nodes require structural
1116 equality checks, because they resolve different based on the
1118 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1119 require structural equality checks (for now).
1120 (build_ptrmemfunc_type): Build the canonical pointer to member
1122 (compute_array_index_type): Whenever we build a new index type
1123 to represent the size of an array in a template, we need to mark
1124 this index type as requiring structural equality. This goes for
1125 arrays with value-dependent sizes with the current ABI, or all
1127 * tree.c (cplus_array_hash): New.
1128 (struct cplus_array_info): New.
1129 (cplus_array_compare): New.
1130 (cplus_array_htab): New.
1131 (build_cplus_array_type_1): Use a hash table to cache the array
1132 types we build. Build the canonical array type for each array
1134 (cp_build_qualified_type_real): When building a cv-qualified array
1135 type, use the hash table of array types and build canonical array
1137 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1138 use structural equality (for now).
1139 * cp-tree.h (COMPARE_STRUCTURAL): New.
1140 * pt.c (canonical_template_parms): New.
1141 (canonical_type_parameter): New.
1142 (process_template_parm): Find the canonical type parameter.
1143 (lookup_template_class): When we have named the primary template
1144 type, set the canonical type for our template class to the primary
1145 template type. If any of the template arguments need structural
1146 equality checks, the template class needs structural equality
1148 (tsubst): When reducing the level of a template template
1149 parameter, we require structural equality tests for the resulting
1150 parameter because its template parameters have not had their types
1151 canonicalized. When reducing a template type parameter, find the
1152 canonical reduced type parameter.
1153 (any_template_arguments_need_structural_equality_p): New.