1 2007-10-22 Jason Merrill <jason@redhat.com>
4 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
5 * pt.c (apply_late_template_attributes): Splice out dependent
6 attributes from DECL_ATTRIBUTES.
8 * decl.c (cxx_maybe_build_cleanup): Use build_address.
10 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
12 * typeck.c (build_binary_op) : Use appropriate warning option
13 instead of unnamed warning.
15 2007-10-16 Paolo Carlini <pcarlini@suse.de>
18 * pt.c (current_template_args): Do not change TREE_LIST elements
19 with a TREE_VALUE of error_mark_node.
21 2007-10-16 Mark Mitchell <mark@codesourcery.com>
23 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
24 * decl.c (start_decl): Tidy.
25 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
27 (grokdeclarator): Clarify comment.
29 2007-10-14 Andrew Pinski <pinskia@gmail.com>
32 * decl.c (grokfndecl): Return NULL after the "definition of
33 implicitly-declared" error happened.
35 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
38 * call.c (build_user_type_conversion_1): Do not consider conversion
39 functions to convert a (possibly cv-qualified) object to the (possibly
40 cv-qualified) same object type (or a reference to it), to a (possibly
41 cv-qualified) base class of that type (or a reference to it).
43 2007-10-12 Paolo Carlini <pcarlini@suse.de>
45 * pt.c (tsubst): Use template_parm_level_and_index.
47 2007-10-12 Jakub Jelinek <jakub@redhat.com>
50 * parser.c (cp_parser_compound_statement): Handle label-declarations
51 at the beginning of the compound statement.
52 (cp_parser_block_declaration): Issue diagnostics about __label__
53 not at the beginning of a block.
55 2007-10-11 Paolo Carlini <pcarlini@suse.de>
58 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
59 to convert_template_argument.
60 (coerce_template_parms): Return error_mark_node after fixed-length
62 (tsubst_decl): Check for error_mark_node the return value of the
63 first tsubst in 'case VAR_DECL'.
65 2007-10-08 Ollie Wild <aaw@google.com>
67 * typeck2.c (digest_init): Call cplus_expand_constant after
68 convert_for_initialization.
69 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
70 * expr.c (cplus_expand_constant): Updated function description.
72 2007-10-04 Jason Merrill <jason@redhat.com>
75 * call.c (initialize_reference): Handle local static reference
78 2007-10-03 Jason Merrill <jason@redhat.com>
81 * name-lookup.c (push_namespace_with_attrs): Fold back into...
82 (push_namespace): Here.
83 (handle_namespace_attrs): New fn for the attr code.
84 (leave_scope): Don't pop_visibility.
85 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
86 * parser.c (cp_parser_namespace_definition): Call
87 handle_namespace_attrs and pop_visibility as appropriate.
90 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
92 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
94 * decl.c (duplicate_decls): Preserve linkage flags for mere
95 redeclarations of gnu_inline definitions.
97 2007-10-03 Jason Merrill <jason@redhat.com>
100 * decl.c (wrap_cleanups_r): New fn.
101 (wrap_temporary_cleanups): New fn.
102 (initialize_local_var): Call it.
104 2007-09-29 Jason Merrill <jason@redhat.com>
107 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
108 constant to not have DECL_EXTERNAL if it's file-local.
110 2007-09-28 Ollie Wild <aaw@google.com>
113 2007-09-27 Ollie Wild <aaw@google.com>
115 * typeck2.c (digest_init): Call cplus_expand_constant after
116 convert_for_initialization.
117 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
118 * expr.c (cplus_expand_constant): Updated function description.
120 2007-09-28 Jason Merrill <jason@redhat.com>
123 * class.c (layout_empty_base): Take rli parameter, update
124 rli->record_align if empty base has user-specified alignment.
125 (build_base_field): Pass rli to it.
127 2007-09-28 Paolo Carlini <pcarlini@suse.de>
130 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
132 2007-09-28 Paolo Carlini <pcarlini@suse.de>
135 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
136 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
137 (dump_parameters): Just call dump_type for argument packs too.
139 2007-09-28 Jakub Jelinek <jakub@redhat.com>
142 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
143 qualification by creating qualified PACK_EXPANSION_PATTERN and
144 then calling make_pack_expansion on it.
146 2007-09-27 Ollie Wild <aaw@google.com>
148 * typeck2.c (digest_init): Call cplus_expand_constant after
149 convert_for_initialization.
150 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
151 * expr.c (cplus_expand_constant): Updated function description.
153 2007-09-27 Jason Merrill <jason@redhat.com>
156 * decl2.c (is_late_template_attribute): Don't crash on unknown
159 2007-09-27 Paolo Carlini <pcarlini@suse.de>
162 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
163 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
164 spaces in the formatting.
165 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
167 2007-09-27 Jakub Jelinek <jakub@redhat.com>
169 * error.c (cxx_print_error_function): Add third argument, pass
170 it over to lhd_print_error_function.
171 (cp_print_error_function): If diagnostic->abstract_origin, print
173 * cp-tree.h (struct diagnostic_info): New forward decl.
174 (cxx_print_error_function): Add third argument.
176 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
179 * name-lookup.c (pushtag): Do not create an implicit typedef before
180 the associated type declaration is known to be valid.
182 2007-09-25 Jakub Jelinek <jakub@redhat.com>
184 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
185 rather than pointers.
187 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
190 * search.c (check_final_overrider): Fail if
191 targetm.comp_type_attributes returns 0.
193 2007-09-24 Jason Merrill <jason@redhat.com>
196 * pt.c (resolve_typename_type): Don't look things up in the original
197 template if it would mean losing template arguments.
199 2007-09-24 Jakub Jelinek <jakub@redhat.com>
202 * cp-tree.h (cxx_type_hash_eq): New prototype.
203 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
204 * tree.c (cxx_type_hash_eq): New function.
206 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
209 * tree.c (cp_build_qualified_type_real): Build a canonical
210 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
212 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
216 * tree.c (cplus_array_compare): Compare pointers, not types.
217 (build_cplus_array_type_1): Store new array type into the hash
218 table before building the canonical type; build the canonical type
220 (cp_build_qualified_type_real): Put all of the array types with
221 cv-qualified element types into the C++ array hash table, built as
222 variants of the unqualified versions.
224 2007-09-23 Jason Merrill <jason@redhat.com>
227 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
228 for deprecation warnings.
230 2007-09-22 Jason Merrill <jason@redhat.com>
233 * call.c (build_over_call): Warn about deprecated virtuals.
236 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
237 (MAYBE_TAGGED_TYPE_P): Remove.
238 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
239 instead of calling is_late_template_attribute again.
240 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
241 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
242 Don't crash on typedefs from non-template classes.
243 * decl2.c (grokfield): Don't sorry about attrs on template parms.
244 (is_late_template_attribute): All attributes applied to template
245 parms or typename types are dependent. Static.
246 (splice_template_attributes): Pass decl through.
247 (save_template_attributes): Likewise.
249 2007-09-20 Jakub Jelinek <jakub@redhat.com>
252 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
253 returned from tsubst_pack_expansion.
254 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
255 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
257 2007-09-20 Paolo Carlini <pcarlini@suse.de>
260 * semantics.c (finish_id_expression): Use consistently
261 context_for_name_lookup.
262 * decl.c (fixup_anonymous_aggr): Fix error message for
263 anonymous struct (vs union).
265 2007-09-19 Jason Merrill <jason@redhat.com>
268 * pt.c (tsubst): Handle typedefs by looking for the specialization.
269 (retrieve_specialization): Only tagged types use
270 DECL_TEMPLATE_INSTANTIATIONS.
271 (instantiate_class_template): Push nested classes too.
272 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
274 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
275 * init.c (is_aggr_type): Remove redundant tests.
276 * class.c (push_nested_class): Use CLASS_TYPE_P.
278 2007-09-20 Paolo Carlini <pcarlini@suse.de>
281 * init.c (build_zero_init): If, recursively, build_zero_init
282 returns a NULL_TREE, do not append it to the VEC of constructors.
284 2007-09-18 Jason Merrill <jason@redhat.com>
287 * pt.c (apply_late_template_attributes): Set processing_template_decl.
288 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
289 ATTR_FLAG_TYPE_IN_PLACE.
290 (tsubst): Do unqualified lookup to find typedefs from current class.
291 [ARRAY_TYPE]: Propagate alignment info.
292 * decl2.c (is_late_template_attribute): Only defer handling of
293 attribute aligned if the expression is dependent.
294 (save_template_attributes): If we're deferring any attributes,
295 make this a naming typedef.
297 2007-09-18 Paolo Carlini <pcarlini@suse.de>
300 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
301 va_arg instead of __builtin_va_arg.
303 2007-09-18 Paolo Carlini <pcarlini@suse.de>
306 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
307 (pp_cxx_primary_expression): Use it.
308 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
309 * error.c (dump_expr): Use it.
311 2007-09-18 Paolo Carlini <pcarlini@suse.de>
314 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
315 out case TYPEID_EXPR to...
316 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
317 and pp_cxx_right_paren.
318 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
319 * error.c (dump_expr): Use it.
321 2007-09-18 Paolo Carlini <pcarlini@suse.de>
324 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
325 (pp_cxx_primary_expression): Use it.
326 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
327 * error.c (dump_expr): Use it.
329 2007-09-16 Paolo Carlini <pcarlini@suse.de>
332 * init.c (build_new): Remove warning for zero-element
335 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
338 * call.c (maybe_handle_implicit_object): Set this_p, clear
339 rvaluedness_matches_p.
340 (compare_ics): Do not compare rvaluedness matching when one of the
341 operands is an implicit object.
343 2007-09-14 Jason Merrill <jason@redhat.com>
345 PR c++/17743, c++/19163
346 * decl2.c (is_late_template_attribute): New fn.
347 (splice_template_attributes, save_template_attributes): New fns.
348 (cplus_decl_attributes): Call save_template_attributes.
349 * pt.c (apply_late_template_attributes): New fn.
350 (instantiate_class_template, tsubst_decl): Use it.
351 * cp-tree.h: Declare is_late_template_attribute.
353 2007-09-13 Tom Tromey <tromey@redhat.com>
355 * parser.c (cp_lexer_new_main): Don't use
356 c_lex_return_raw_strings.
357 (cp_lexer_get_preprocessor_token): Update. Add special case when
360 2007-09-11 Jan Hubicka <jh@suse.cz>
362 * method.c (use_thunk): Use tree_rest_of_compilation
363 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
364 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
365 * cp-tree.h (expand_body): Kill.
366 (emit_associated_thunks): Declare.
367 * semantics.c (emit_associated_thunks): Export.
370 2007-09-09 David Daney <ddaney@avtrex.com>
373 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
374 to calculate cookie_ptr.
376 2007-09-08 Jason Merrill <jason@redhat.com>
379 * pt.c (most_specialized_class): Set processing_template_decl
380 while tsubsting partial spec args.
382 2007-09-06 Jason Merrill <jason@redhat.com>
384 * decl2.c (get_guard): Copy visibility from the guarded variable.
386 2007-09-06 Jan Hubicka <jh@suse.cz>
388 * semantics.c (expand_body): Do not mark arguments of clones used.
390 2007-09-06 Paolo Carlini <pcarlini@suse.de>
393 * decl.c (cp_finish_decl): When processing_template_decl,
394 deal correctly with init as TREE_LIST.
396 2007-09-06 Tom Tromey <tromey@redhat.com>
398 * decl.c (finish_function): Put return's location on line zero of
401 2007-09-05 Jason Merrill <jason@redhat.com>
404 * except.c (prepare_eh_type): Use type_decays_to.
407 * init.c (build_delete): Use build_headof to get the address of the
408 complete object if we aren't using the deleting destructor.
409 * rtti.c (build_headof): No longer static.
410 * cp-tree.h: Declare it.
412 2007-09-06 Jakub Jelinek <jakub@redhat.com>
414 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
415 decl if a prototype for XX is provided with throw().
418 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
419 on __*_chk non-__builtin_* decls.
421 2007-09-05 Paolo Carlini <pcarlini@suse.de>
424 * semantics.c (finish_id_expression): Use context_for_name_lookup
425 insted of DECL_CONTEXT, to see through anonymous structs and unions.
426 * class.c (finish_struct_anon): Deal correctly with anonymous
427 structs (vs unions, as GNU extension) in error messages.
429 2007-09-05 Jan Hubicka <jh@suse.cz>
431 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
432 call, DECL_EXTERNAL checks and current_function_decl saving.
434 2007-09-05 Paolo Carlini <pcarlini@suse.de>
437 * parser.c (cp_parser_primary_expression): Return error_mark_node
438 when a statement-expression is found in a template-argument list.
440 2007-09-04 Jason Merrill <jason@redhat.com>
442 * except.c (initialize_handler_parm): Use
443 fold_build_cleanup_point_expr.
446 * call.c (reference_binding): Don't look for user-defined conversions
450 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
451 the MUST_NOT_THROW_EXPR.
453 2007-09-04 Richard Sandiford <richard@codesourcery.com>
455 * decl.c (cp_finish_decl): Call determine_visibility before
456 make_rtl_for_nonlocal_decl.
458 2007-09-04 Jason Merrill <jason@redhat.com>
461 * pt.c (most_specialized_class): Substitute outer template
462 arguments into the arguments of a member template partial
464 (strip_innermost_template_args): New fn.
466 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
468 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
470 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
472 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
473 * decl.c (cp_make_fname_decl): Likewise,
474 * parser.c (cp_parser_string_literal): Likewise,
475 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
476 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
479 2007-09-02 Paolo Carlini <pcarlini@suse.de>
482 * typeck.c (build_unary_op): Fix error message for
483 Boolean expression as operand to operator--.
485 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
487 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
488 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
491 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
494 * init.c (build_default_init): Make extern.
495 * cp-tree.h (build_default_init): Declare here.
496 * pt.c (tsubst_expr): When the instantiation of the initializer of
497 a variable results in an empty list, default-initialize the
499 (tsubst_copy_and_build): When the instantiation of the initializer
500 in a new expression results in an empty initializer list,
501 default-initialize it.
503 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
505 * mangle.c (write_type): Change mangling of rvalue reference from
508 2007-08-31 Jakub Jelinek <jakub@redhat.com>
510 * decl.c (duplicate_decls): Remove duplicated line.
512 2007-08-31 Paolo Carlini <pcarlini@suse.de>
515 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
516 BOUND_TEMPLATE_TEMPLATE_PARM.
518 2007-08-31 Paolo Carlini <pcarlini@suse.de>
521 * search.c (lookup_member): Check the name argument for
524 2007-08-31 Paolo Carlini <pcarlini@suse.de>
527 * parser.c (cp_parser_trait_expr): Check rerurn value of
530 2007-08-30 Ollie Wild <aaw@google.com>
532 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
533 convert_ptrmem for pointer to member conversions.
534 (convert_to_pointer_force): Update cp_convert_to_pointer call.
535 (ocp_convert): Update cp_convert_to_pointer call.
536 * typeck.c (convert_ptrmem): Add conditional for null pointers to
538 (build_static_cast_1): Check can_convert for conversions in either
540 (get_delta_difference_1): New function.
541 (get_delta_difference): Refactor to call get_delta_difference_1.
543 2007-08-30 Jakub Jelinek <jakub@redhat.com>
545 * decl.c (start_preparsed_function): Set
546 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
548 2007-08-28 Paolo Carlini <pcarlini@suse.de>
551 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
552 BOUND_TEMPLATE_TEMPLATE_PARM.
554 2007-08-28 Jakub Jelinek <jakub@redhat.com>
558 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
559 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
561 2007-08-27 Jason Merrill <jason@redhat.com>
564 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
565 Look inside STMT_EXPR.
566 * semantics.c (stmt_expr_value_expr): New fn.
567 * cp-tree.h: Declare it.
570 * decl.c (groktypename): Ignore attributes applied to class type.
572 2007-08-28 Richard Guenther <rguenther@suse.de>
574 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
576 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
578 * error.c (dump_expr): Handle COMPLEX_CST.
579 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
580 (pp_cxx_expression): Likewise.
582 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
584 * decl.c (GNU_INLINE_P): New.
585 (duplicate_decls): Handle gnu_inline. Merge attributes and
586 some flags in overriding definitions.
587 (redeclaration_error_message): Handle gnu_inline.
588 (start_preparsed_function): Likewise.
590 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
592 * call.c (sufficient_parms_p): Constify.
593 * class.c (same_signature_p): Likewise.
594 * cp-gimplify.c (is_invisiref_parm,
595 cxx_omp_privatize_by_reference): Likewise.
596 * cp-objcp-common.c (has_c_linkage): Likewise.
597 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
598 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
599 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
600 num_artificial_parms_for, comp_template_parms,
601 template_parameter_pack_p, any_dependent_template_arguments_p,
602 any_type_dependent_arguments_p, any_value_dependent_elements_p,
603 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
604 zero_init_p, member_p, cp_lvalue_kind,
605 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
606 varargs_function_p, is_dummy_object, special_function_kind,
607 string_conv_p, type_unknown_p, comp_except_specs, compparms,
608 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
609 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
610 cp_has_mutable_p, at_least_as_qualified_p,
611 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
612 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
613 * except.c (nothrow_libfn_p): Likewise.
614 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
616 * pt.c (comp_template_parms, template_parameter_pack_p,
617 any_type_dependent_arguments_p, any_value_dependent_elements_p,
618 any_dependent_template_arguments_p): Likewise.
619 * repo.c (repo_export_class_p): Likewise.
620 * semantics.c (anon_aggr_type_p): Likewise.
621 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
622 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
623 varargs_function_p, member_p, is_dummy_object, pod_type_p,
624 zero_init_p, special_function_p): Likewise.
625 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
626 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
627 compparms, invalid_nonstatic_memfn_p,
628 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
629 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
630 cp_has_mutable_p, lvalue_or_else): Likewise.
632 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
634 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
635 * cp-objcp-common.c (cp_tree_size): Ditto.
636 * tree.c (cp_walk_subtrees): Ditto
637 * cp-tree.def (TINST_LEVEL): Go away.
638 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
639 move together with other non-tree structs.
640 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
641 (union lang_tree_node): Eliminate tinst_level field.
642 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
643 (current_instantiation, outermost_tinst_level): Return
644 a "struct tinst_level *".
646 * error.c (print_instantiation_partial_context): Change second
647 parameter to a "struct tinst_level *". Replace accessor macros
649 (print_instantiation_full_context): Likewise.
650 * lex.c (in_main_input_context): Likewise.
652 * pt.c (struct pending_templates): New.
653 (pending_templates, last_pending_template): Use it as a type.
654 (current_tinst_level): Change typo to "struct tinst_level *"
655 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
656 (add_pending_template): Construct a "struct pending_template".
657 Replace TINST_LEVEL accessor macros with field access.
658 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
659 (pop_tinst_level): Likewise.
660 (instantiate_pending_templates): Likewise. Factor common code used
661 when an instantiation has been done.
662 (outermost_tinst_level): Replace tree_last with loop.
663 (current_instantiation): Return a "struct tinst_level *".
665 2007-08-24 Ollie Wild <aaw@google.com>
667 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
668 * name-lookup.h (cp_binding_level): Remove vtables member.
670 2007-08-24 Richard Guenther <rguenther@suse.de>
672 * tree.c (cp_cannot_inline_tree_fn): Remove.
673 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
674 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
677 2007-08-24 Jakub Jelinek <jakub@redhat.com>
680 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
681 error_mark_node right away if build_expr_type_conversion
685 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
686 is error_mark_node rather than NULL_TREE.
687 * pt.c (check_explicit_specialization): Likewise.
690 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
691 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
693 2007-08-22 Jason Merrill <jason@redhat.com>
696 * pt.c (outermost_tinst_level): New function.
697 * lex.c (in_main_input_context): New function.
698 * cp-tree.h: Declare it.
699 * decl2.c (constrain_class_visibility): Use it to avoid warning
700 about uses of the anonymous namespace in the main input file.
702 2007-08-21 Jakub Jelinek <jakub@redhat.com>
704 * init.c (build_new_1): Use get_target_expr instead of save_expr.
706 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
709 * class.c (finish_struct_1): Warn when a class has virtual
710 functions and accessible non-virtual destructor.
712 2007-08-20 Richard Guenther <rguenther@suse.de>
716 * call.c (build_new_method_call): Convert initializer to
718 * init.c (build_aggr_init): Do not fiddle with types.
719 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
720 * except.c (build_throw): Do not drop qualifiers for the
722 * typeck.c (get_member_function_from_ptrfunc): Do not
723 fiddle with types, instead convert.
724 (build_ptrmemfunc1): Convert to the target type for
726 (gfc_trans_allocate): Convert result to target type.
727 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
728 pointer-to-member structures shall have alias set zero as well.
730 2007-08-20 Richard Guenther <rguenther@suse.de>
732 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
734 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
735 (nonstatic_local_decl_p): Likewise.
736 * tree.c (cp_auto_var_in_fn_p): Remove.
737 * decl.c (nonstatic_local_decl_p): Remove.
739 2007-08-20 Richard Guenther <rguenther@suse.de>
741 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
743 * tree.h (cp_walk_tree): New define to walk_tree_1 with
744 cp_walk_subtrees lh parameter.
745 (cp_walk_tree_without_duplicates): New define to
746 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
747 * tree.c (count_trees): Call
748 cp_walk_tree_without_duplicates.
749 (verify_stmt_tree): Call cp_walk_tree.
750 (break_out_target_exprs): Likewise.
751 (WALK_SUBTREE): Likewise.
752 * cp-gimplify.c (cp_genericize): Likewise.
753 * cp-pt.c (find_parameter_packs_r): Likewise.
754 (uses_parameter_packs): Likewise.
755 (make_pack_expansion): Likewise.
756 (check_for_bare_parameter_packs): Likewise.
757 (for_each_template_parm): Likewise.
758 * decl.c (check_default_argument): Call
759 cp_walk_tree_without_duplicates.
760 * except.c (build_throw): Likewise.
761 * decl2.c (type_visibility): Likewise.
762 * semantics.c (expand_or_defer_fn): Likewise.
763 (finalize_nrv): Call cp_walk_tree.
765 2007-08-20 Jakub Jelinek <jakub@redhat.com>
768 * init.c (build_new_1): Rename placement_var variable to placement_expr.
769 Initialize it with save_expr rather than get_temp_regvar.
771 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
774 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
777 2007-08-17 Ollie Wild <aaw@google.com>
780 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
781 declarations into appropriate slots for comparison. Fix type
784 2007-08-17 Paolo Carlini <pcarlini@suse.de>
787 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
788 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
790 2007-08-17 Paolo Carlini <pcarlini@suse.de>
793 * parser.c (cp_parser_class_head): Improve error message.
795 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
797 * pt.c (instantiate_decl): Set input_location
798 for the function end.
800 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
802 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
804 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
805 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
806 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
807 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
808 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
809 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
810 * typeck.c (cp_type_quals): Likewise.
811 * typeck2.c (cxx_incomplete_type_diagnostic,
812 cxx_incomplete_type_error): Likewise.
814 2007-08-16 Paolo Carlini <pcarlini@suse.de>
817 * pt.c (tsubst_friend_function): When check_classfn
818 returns error_mark_node likewise return it.
820 2007-08-15 Jakub Jelinek <jakub@redhat.com>
823 * typeck.c (check_return_expr): Don't NRV optimize vars in
825 * decl.c (finish_function): Comment fix.
827 2007-08-15 Paolo Carlini <pcarlini@suse.de>
830 * pt.c (push_template_decl_real): Depending on TYPE_P
831 use either TYPE_CONTEXT or DECL_CONTEXT.
833 2007-08-14 Mark Mitchell <mark@codesourcery.com>
835 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
836 constructors and destructors return this.
838 2007-08-14 Paolo Carlini <pcarlini@suse.de>
841 * decl2.c (check_classfn): Return error_mark_node in case of error;
842 in that case, do not call add_method.
843 * decl.c (start_decl): Deal with check_classfn returning
845 (grokfndecl): Likewise.
846 * pt.c (tsubst_friend_function): Likewise.
848 2007-08-14 Andrew Pinski <pinskia@gmail.com>
851 * typeck.c (build_binary_op): Disallow vector float types with
852 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
854 2007-08-11 Ian Lance Taylor <iant@google.com>
856 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
858 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
860 2007-08-10 Ollie Wild <aaw@google.com>
862 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
864 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
866 (unqualified_namespace_lookup): Fix ambiguous_decl call.
867 (lookup_using_namespace): Fix ambiguous_decl call.
868 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
870 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
872 * call.c (name_as_c_string): Use CONST_CAST.
873 * decl.c (build_decl): Likewise.
874 * parser.c (cp_parser_string_literal): Likewise.
876 2007-08-10 Paolo Carlini <pcarlini@suse.de>
879 * error.c (dump_expr): Consistently use the *_cxx_*
880 variants of the pretty-print functions.
882 2007-08-10 Paolo Carlini <pcarlini@suse.de>
885 * decl.c (check_special_function_return_type): Just error
886 on return type specified for conversion operator.
888 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
890 * typeck2.c (readonly_error): Handle general expressions.
891 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
893 2007-08-06 Dan Hipschman <dsh@google.com>
895 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
896 access function name.
898 2007-08-04 Alfred Minarik <a.minarik@aon.at>
901 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
902 * g++spec.c (lang_specific_driver): Check them.
904 2007-08-06 Paolo Carlini <pcarlini@suse.de>
907 * pt.c (inline_needs_template_parms): Fix comment; change return type
910 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
913 2007-03-26 Dirk Mueller <dmueller@suse.de>
915 * parser.c (cp_parser_member_declaration): Pedwarn
916 about stray semicolons after member declarations.
918 2007-08-02 Lee Millward <lee.millward@gmail.com>
923 * parser.c (cp_parser_asm_definition): Detect and discard asm
924 statements with invalid inputs or outputs.
925 (cp_parser_asm_operand_list): Return error mark node if any
926 of the operands are invalid. Adjust documentation.
928 2007-08-02 Nick Clifton <nickc@redhat.com>
930 * typeck.c: Change copyright header to refer to version 3 of the
931 GNU General Public License and to point readers at the COPYING3
932 file and the FSF's license web page.
933 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
934 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
935 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
936 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
937 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
938 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
939 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
940 name-lookup.h, parser.c: Likewise.
942 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
945 * call.c (magic_varargs_p): Honor the "type generic" attribute.
947 2007-07-30 Paolo Carlini <pcarlini@suse.de>
950 * semantics.c (finish_label_stmt): Reject the __label__
951 extension outside function scopes.
953 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
955 * parser.c (eof_token): Un-constify.
956 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
957 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
960 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
962 * pt.c, tree.c, typeck2.c: Fix comment typos.
964 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
965 Mark Mitchell <mark@codesourcery.com>
968 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
969 hidden due to friend declarations in local classes.
971 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
973 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
974 * cp-tree.def (DECLTYPE_TYPE): New.
975 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
976 (dump_type_prefix): Ditto.
977 (dump_type_suffix): Ditto.
978 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
979 * mangle.c (write_type): Handle DECLTYPE_TYPE.
980 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
982 (DECLTYPE_TYPE_EXPR): New.
983 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
984 (finish_declared_type): Declare.
985 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
987 (pp_cxx_type_id): Ditto.
988 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
989 (tsubst): Substitute into a DECLTYPE_TYPE node.
990 (tsubst_copy): Ditto.
991 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
993 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
994 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
995 structural equality (because we can't hash the expressions).
996 (finish_declared_type): New.
997 * lex.c (reswords): Add "decltype" keyword.
998 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
999 (cp_parser_postfix_expression): Add member_access_only_p to
1000 restrict postfix expression to member access expressions.
1001 (cp_parser_unary_expression): Update call to
1002 cp_parser_postfix_expression to reflect new parameter.
1003 (cp_parser_declared_type): New.
1004 (cp_parser_simple_type_specifier): Parse decltype types.
1006 2007-07-27 Mark Mitchell <mark@codesourcery.com>
1009 * call.c (convert_for_arg_passing): Only widen bitfields to their
1010 declared types if necessary.
1012 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1014 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1017 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1019 * decl.c (typename_hash, typename_compare): Constify.
1020 * mangle.c (hash_type, compare_type): Likewise.
1021 * pt.c (eq_local_specializations, hash_local_specialization):
1023 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1024 list_hash): Likewise.
1025 * typeck2.c (pat_compare): Likewise.
1027 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
1029 * method.c (implicitly_declare_fn): Increase alignment if member
1030 function pointer format requires it.
1032 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1035 * typeck.c (check_return_expr): Do not pass a null argument
1038 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1041 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1044 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1047 * typeck.c (convert_arguments): Only use default args if we have
1051 * typeck.c (structural_comptypes): No need to check
1052 resolve_typename_type return value here.
1053 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1054 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1055 original type rather than error_mark_node in case of failure.
1056 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1057 resolve_typename_type result check.
1058 (cp_parser_direct_declarator, cp_parser_head,
1059 cp_parser_constructor_declarator_p): Likewise.
1061 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1063 * pt.c (template_parms_variadic_p): Remove.
1064 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1066 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1069 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1070 argument to dump_aggr_init_expr_args instead of false.
1072 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1074 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1075 canonical types; otherwise, fall back to structural type
1076 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1077 internal compiler error if the canonical types are wrong.
1079 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1082 * parser.c (cp_parser_make_indirect_declarator): When the
1083 the code argument is ERROR_MARK return cp_error_declarator.
1085 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1088 * decl.c (cxx_init_decl_processing): Don't set
1089 force_align_functions_log.
1090 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1091 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1092 FUNCTION_DECL, return its alignment.
1094 2007-07-09 Richard Guenther <rguenther@suse.de>
1096 * decl.c (start_preparsed_function): Do not promote return type.
1098 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1101 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1103 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1106 * pt.c (resolve_overloaded_unification): Robustify. Return a
1108 (type_unification_real): Adjust accordingly.
1110 2007-07-06 Richard Guenther <rguenther@suse.de>
1112 * init.c (build_new_1): Use the correct pointer type.
1113 * typeck2.c (build_m_component_ref): Likewise.
1115 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1118 * init.c (build_zero_init): Always build an initializer for
1120 * typeck2.c (build_functional_cast): Use build_zero_init.
1123 * init.c (build_new_1): Always pass the allocation function to
1124 build_op_delete_call.
1125 * call.c (build_op_delete_call): Handle operator delete with a
1126 variable-argument list. Do not issue an error when no matching
1127 deallocation function is available for a new operator.
1130 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1131 * decl.c (value_dependent_init_p): New function.
1132 (cp_finish_decl): Use it.
1133 * pt.c (value_dependent_expression_p): Use
1134 any_value_dependent_elements_p.
1135 * parser.c (cp_parser_primary_expression): Add comment about
1136 treating dependent qualified names as integral
1137 constant-expressions.
1139 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1141 * decl.c (build_ptrmemfunc_type): Always use structural equality
1142 tests when comparing pointer-to-member-function types, because the
1143 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1146 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1148 * init.c (build_new): Tweak comment.
1150 2007-06-29 Dave Brolley <brolley@redhat.com>
1153 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1154 type to its base type and number of elements here.
1155 * init.c (build_new): Call complete_type_or_else to ensure that the
1156 type is complete and to issue a diagnostic if it is not.
1157 (build_new_1): Don't call complete_type_or_else here.
1159 2007-07-03 Richard Guenther <rguenther@suse.de>
1162 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1165 2007-07-02 Simon Baldwin <simonb@google.com>
1167 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1168 for inner-style nested forward declarations that don't declare
1171 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1174 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1175 DECL_P in not a variable and appears more than once error messages.
1177 2007-07-01 Ollie Wild <aaw@google.com>
1179 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1180 (select_decl): Remove function.
1181 (unqualified_namespace_lookup): Populate binding by calling
1182 ambiguous_decl. Remove select_decl call.
1183 (lookup_qualified_name): Remove select_decl call.
1184 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1185 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1186 generation when name lookup is ambiguous.
1188 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1191 * init.c (build_new_1): Use structural equality on the copy of the
1194 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1196 * decl2.c (determine_visibility): Implement
1197 flag_visibility_ms_compat effect on type info.
1198 * decl.c (cxx_init_decl_processing): Implement
1199 global effect of flag_visibility_ms_compat.
1201 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1203 * decl2.c (start_objects): Mark constructor-running function
1206 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1209 * decl.c (grokdeclarator): Reset friendp for member functions declared
1210 friend of their own class.
1212 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1214 * decl2.c (determine_visibility): Don't look for dllexport here.
1215 (determine_visibility_from_class): Tidy.
1217 2007-06-18 Simon Baldwin <simonb@google.com>
1220 * parser.c (cp_parser_single_declaration): Added check for storage
1221 class other than sc_none in parsed declaration, and a flag to indicate
1222 if the call is part of an explicit template specialization parse.
1223 * (cp_parser_explicit_specialization): Specialization check flag added
1224 to call to cp_parser_single_declaration(), set true.
1225 * (cp_parser_template_declaration_after_export): Specialization check
1226 flag added to call to cp_parser_single_declaration(), set false.
1227 * pt.c (check_explicit_specialization): Added code to copy visiblity
1228 and linkage from the templated function to the explicit specialization.
1230 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1232 * typeck.c (build_binary_op): For templates build the
1233 expression in pieces to avoid the assert in build2_stat.
1234 (get_member_function_from_ptrfunc):
1235 Change over to using POINTER_PLUS_EXPR and convert
1236 the second operand to sizetype.
1237 * typeck2.c (build_m_component_ref): Likewise.
1238 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1239 instead of PLUS_EXPR for pointers.
1240 (build_new_1): Likewise.
1241 (build_vec_delete_1): Likewise.
1242 (build_vec_delete): Likewise.
1243 * class.c (build_base_path): Likewise.
1244 (build_base_path): Likewise.
1245 (convert_to_base_statically): Likewise.
1246 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1247 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1248 instead of PLUS_EXPR.
1249 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1250 instead of PLUS_EXPR for pointers.
1251 * call.c (build_special_member_call): Likewise.
1252 * rtti.c (build_headof): Likewise.
1253 Use sizetype instead of ptrdiff_type_node.
1254 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1255 instead of PLUS_EXPR for pointers.
1256 * except.c (expand_start_catch_block): Do a
1257 NEGATIVE and then a POINTER_PLUS_EXPR instead
1259 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1260 PLUS_EXPR on pointer types over to use
1261 POINTER_PLUS_EXPR and remove the conversion
1262 to the pointer types.
1263 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1264 adding to a pointer type. Use size_int instead of
1265 ssize_int. Convert the index to sizetype before
1266 adding it to the pointer.
1268 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1270 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1271 (DECL_ANON_UNION_VAR_P): New macro.
1272 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1273 than DECL_VAR_MARKED_P, to keep track of which variables we have
1275 * decl.c (redeclaration_error_message): Complain about redeclaring
1276 anonymous union members at namespace scope.
1277 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1279 2007-06-14 Geoff Keating <geoffk@apple.com>
1281 * decl2.c (determine_visibility): Ensure that functions with
1282 hidden types as parameters are hidden.
1285 * decl2.c (determine_visibility): Remove duplicate code for
1288 2007-06-12 Ian Lance Taylor <iant@google.com>
1291 * init.c (avoid_placement_new_aliasing): New static function.
1292 (build_new_1): Call it.
1294 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1296 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1297 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1299 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1302 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1303 on init, the non-decl cond operand and increment value.
1305 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1308 * decl.c (check_initializer): Report an error when a brace enclosed
1309 initializer is used for a non-aggregate type in C++98.
1310 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1312 (grokdeclarator): Likewise.
1313 (move_fn_p): Likewise.
1314 * typeck.c (check_return_expr): Likewise.
1315 * call.c (reference_binding): Likewise.
1316 * error.c (cp_cpp_error): Likewise.
1317 * pt.c (check_default_tmpl_args): Likewise.
1319 * lex.c (init_reswords): Likewise.
1320 * parser.c (p_parser_primary_expression): Likewise.
1321 (TOKEN_PRECEDENCE): Likewise.
1322 (cp_parser_init_declarator): Likewise.
1323 (cp_parser_ptr_operator): Likewise.
1324 (cp_parser_parameter_declaration): Likewise.
1325 (cp_parser_enclosed_template_argument_list): Likewise.
1326 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1327 (cp_parser_next_token_ends_template_argument_p): Likewise.
1329 2007-06-04 Simon Baldwin <simonb@google.com>
1331 * decl.c (grokdeclarator): Readability change. Moved case labels
1332 into direct switch statement scope.
1334 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1336 * call.c (convert_like_real): Remove pointless code.
1338 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1340 * decl.c (get_atexit_fn_ptr_type): New function.
1341 (get_atexit_node): Use it.
1342 (start_cleanup_fn): Likewise.
1343 (register_dtor_fn): Use the object's destructor, instead of a
1344 separate cleanup function, where possible.
1345 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1346 (atexit_fn_ptr_type_node): New macro.
1347 * decl2.c (build_cleanup): Use build_address.
1349 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1351 * typeck.c (build_binary_op): Include types in error.
1353 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1356 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1357 needs runtime initialization.
1359 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1362 * semantics.c (finish_trait_expr): Complete the types.
1364 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1365 Douglas Gregor <doug.gregor@gmail.com>
1366 Pedro Lamarao <pedro.lamarao@mndfck.org>
1367 Howard Hinnant <howard.hinnant@gmail.com>
1371 * typeck.c (comptypes): Don't consider rvalue and lvalue
1372 reference types to be equivalent.
1373 (check_return_expr): Move from certain lvalues when returning
1375 * decl.c (grokdeclarator): Implement reference collapsing.
1376 (copy_fn_p): Don't consider constructors taking rvalue references
1377 to be copy constructors.
1379 * call.c (conversion): New "rvaluedness_matches_p" member.
1380 (convert_class_to_reference): Require reference type as first
1381 parameter instead of base type.
1382 (reference_binding): Add logic to handle rvalue references.
1383 (implicit_conversion): Update inaccurate comment.
1384 (convert_like_real): Disable creation of temporaries that are
1385 impossible to initialize for types with move constructors.
1386 (build_over_call): Elide move constructors when possible.
1387 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1388 (maybe_handle_ref_bind): Return conversion instead of type node.
1389 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1390 determine preferred conversion sequences.
1391 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1392 (LOOKUP_PREFER_RVALUE): New.
1393 (DECL_MOVE_CONSTRUCTOR_P): New.
1394 (struct cp_declarator): Add "reference" member for reference
1395 types, with new "rvalue_ref" flag.
1396 (cp_build_reference_type): Declare.
1397 (move_fn_p): Declare.
1398 * error.c (dump_type_prefix): Format rvalue reference types
1399 correctly in error messages.
1400 * except.c (build_throw): Move from certain lvalues when
1402 * mangle.c (write_type): Mangle rvalue references differently
1403 than regular references.
1404 * parser.c (make_reference_declarator): Add boolean parameter for
1406 (cp_parser_make_indirect_declarator): New.
1407 (cp_parser_new_declarator_opt): Call
1408 cp_parser_make_indirect_declarator.
1409 (cp_parser_conversion_declarator_opt): Ditto.
1410 (cp_parser_declarator): Ditto.
1411 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1413 * pt.c (tsubst): Implement reference collapsing.
1414 (maybe_adjust_types_for_deduction): Implement special template
1415 parameter deduction rule for rvalue references.
1416 (type_unification_real): Update calls to
1417 maybe_adjust_types_for_deduction.
1418 (try_one_overload): Ditto.
1419 (unify_pack_expansion): Ditto.
1420 * tree.c (lvalue_p_1): Handle rvalue reference types.
1421 (cp_build_reference_type): New.
1423 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1426 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1427 variables that need runtime initialization.
1429 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1432 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1433 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1434 case POSTDECREMENT_EXPR>): Return the error_mark_node
1435 if either the real or imaginary parts would an
1438 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1439 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1442 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1443 token is a closing brace, false if there are no tokens left.
1444 (cp_parser_namespace_alias_definition): Only consume the next token if
1445 it is a closing brace.
1447 * parser.c (cp_parser_class_specifier): Likewise.
1449 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1451 * semantics.c (finish_member_declaration): Fix a typo in the
1454 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1466 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1467 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1468 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1469 whether everything was okay. Fix indentation.
1470 (push_template_decl_real): Check for bare parameter packs in
1471 function parameters; where errors occur, mark the parameter types
1472 with ERROR_MARK_NODEs to avert ICEs.
1473 (coerce_template_parameter_pack): New.
1474 (coerce_template_parms): Moved parameter pack coercion into
1475 coerce_template_parameter_pack, and permit it anywhere in the
1476 template parameter list (not just at the end). Parameter and
1477 argument indices can vary (somewhat) separately now, so add
1478 PARM_IDX and ARG_IDX.
1479 (fn_type_unification): Don't set an argument pack as incomplete if
1480 no argument pack was deduced.
1481 (type_unification_real): If a type parameter is a parameter pack
1482 and has not otherwise been deduced, it will be deduced to an empty
1484 (more_specialized_fn): Use the actual lengths of the argument
1485 lists when comparing against expansions.
1486 * semantics.c (finish_member_declaration): If a field's type has
1487 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1489 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1492 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1494 2007-05-22 Ollie Wild <aaw@google.com>
1496 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1497 (unqualified_namespace_lookup): Adds check for hidden types.
1499 2007-05-22 Ollie Wild <aaw@google.com>
1501 * decl.c (duplicate_decls): Verify namespace names are unique.
1503 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1505 * decl.c (cxx_maybe_build_cleanup): Handle
1506 __attribute__((cleanup)).
1508 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1510 * cvt.c (cp_convert_and_check): Don't check warnings if the
1513 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1515 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1517 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1520 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1521 type only if is a class type (5.2.8/4).
1523 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1525 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1526 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1527 c_common_unsigned_type.
1529 2007-05-11 Silvius Rus <rus@google.com>
1531 * cp/typeck.c (build_indirect_ref): Add call to
1532 strict_aliasing_warning.
1533 (build_reinterpret_cast_1): Condition call to
1534 strict_aliasing_warning.
1536 2007-05-11 Jan Hubicka <jh@suse.cz>
1538 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1539 * decl2.c (start_objects): ctors and dtors are no longer public.
1540 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1542 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1544 * typeck.c (build_unary_op): Remove code that used to
1545 handle non lvalue increments/decrements.
1547 2007-05-07 Mike Stump <mrs@apple.com>
1549 * parser.c (check_empty_body): Add.
1550 (cp_parser_iteration_statement): Add call to check_empty_body.
1552 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1555 * mangle.c (write_mangled_name): Mangle static variable names.
1556 (write_unqualified_name): Use local-source-name for
1557 namespace-scope static variables.
1559 2007-05-04 Dirk Mueller <dmueller@suse.de>
1561 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1564 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1567 * decl2.c (constrain_class_visibility):
1568 Use strip_pointer_or_array_types instead of strip_array_types.
1570 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1573 * decl.c (reshape_init_r): Don't reshape the first element if it
1574 is a pointer to member function.
1576 2007-04-27 Simon Baldwin <simonb@google.com>
1578 * decl.c (grokparms): Changed message format from %qD to %qE.
1580 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1582 * error.c (maybe_warn_variadic_templates): Variadic templates are
1583 now in C++0x, so only warn about them in C++98 mode.
1585 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1588 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1589 integeral types from vectors types.
1591 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1594 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1595 for type dependent OMP_CLAUSE_DECLs.
1597 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1600 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1601 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1602 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1603 * init.c (build_zero_init): Adjust, as
1604 COMPLEX_TYPE is now a SCALAR_TYPE.
1605 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1606 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1608 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1610 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1611 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1612 (trait_expr_value): Adjust.
1614 2007-04-23 Simon Baldwin <simonb@google.com>
1616 * decl.c (grokparms): Added new error for duplicate function
1617 parameters names in function prototypes, to match gcc behavior.
1619 2007-04-23 Jan Hubicka <jh@suse.cz>
1621 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1624 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1626 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1627 instead of checking GIMPLE_STMT_P in chain_next.
1629 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1632 * call.c (convert_for_arg_passing): Convert bitfields to their
1635 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1638 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1640 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1643 * cp/decl2.c (constrain_class_visibility):
1644 Do not warn about the use of anonymous namespace in the main input file.
1646 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1648 * cp-tree.h (current_template_parms): Fix typo in comment.
1650 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1652 * cp-tree.h, error.c: Fix comment typos.
1654 2007-04-13 Jason Merrill <jason@redhat.com>
1657 * call.c (reference_binding): Add c_cast_p parm. If true,
1658 add quals to TO as needed to make it reference-compatible.
1660 2007-04-11 Jan Hubicka <jh@suse.cz>
1662 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1663 that we are not processing template_decl.
1665 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1668 * class.c (build_base_path): Ensure that the converted pointer has
1669 the same cv-qualification as the input.
1671 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1673 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1675 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1677 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1679 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1680 * tree.c (cp_add_pending_fn_decls): Remove.
1681 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1683 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1685 Revert change removing staticp.
1687 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1689 * cp-objcp-common.c (cxx_staticp): Remove.
1690 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1691 * cp-tree.h (cxx_staticp):
1693 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1695 * class.c (check_for_override): Don't remove dllmport attribute
1698 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1701 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1702 type issue error and return early.
1704 2007-03-30 Jason Merrill <jason@redhat.com>
1707 * typeck.c (cp_type_readonly): New fn.
1708 * cp-tree.h: Declare it.
1709 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1710 (cp_finish_decl): Not here.
1712 2007-03-31 Richard Guenther <rguenther@suse.de>
1714 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1717 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1722 * parser.c (declarator_can_be_parameter_pack): New.
1723 (cp_parser_template_parameter): Only parse the `...' if the
1724 declarator can be a parameter pack.
1725 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1727 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1728 types (they could be used as array bounds).
1729 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1730 (tsubst_pack_expansion): Handle failure to expand parameter
1733 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1736 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1737 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1738 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1739 (CLASS_TYPE_NON_UNION_P): Add.
1740 (struct lang_type_class): Add has_complex_dflt.
1741 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1742 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1743 * cp-tree.def: Add TRAIT_EXPR.
1744 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1745 * lex.c (struct resword): Add __has_nothrow_assign,
1746 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1747 __has_trivial_constructor, __has_trivial_copy,
1748 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1749 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1750 __is_pod, __is_polymorphic, __is_union.
1751 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1752 (cp_parser_trait_expr): New.
1753 * semantics.c (finish_trait_expr, trait_expr_value
1754 classtype_has_nothrow_copy_or_assign_p): New.
1755 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1757 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1758 * class.c (check_bases, check_field_decl, check_bases_and_members):
1759 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1760 * pt.c (uses_template_parms, tsubst_copy_and_build,
1761 value_dependent_expression_p, type_dependent_expression_p): Deal with
1763 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1765 2007-03-29 Richard Guenther <rguenther@suse.de>
1767 * tree.c (cp_walk_subtrees): Do not set input_location.
1769 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1772 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1775 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1777 * parser.c (struct cp_parser): Update comment for
1778 greater_than_is_operator_p.
1779 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1780 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1781 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1782 !GREATER_THAN_IS_OPERATOR_P.
1783 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1784 `>>' operators that will become two `>' tokens in C++0x.
1785 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1786 mode, allowing it to terminate default arguments.
1787 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1788 `>>' like two consecutive `>' tokens.
1789 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1790 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1791 ends a template argument.
1793 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1795 * decl.c (redeclaration_error_message): Complain when redeclaring
1796 a friend function with default template arguments (C++0x mode only).
1797 * cp-tree.h (check_default_tmpl_args): Declare.
1798 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1799 template arguments in function templates. Add support for checking
1800 the default template arguments of friend templates.
1801 (push_template_decl_real): Fix call to check_default_tmpl_args.
1802 (type_unification_real): If a template parameter has not been
1803 deduced but provides a default template argument, substitute into
1804 that default template argument.
1805 * parser.c (cp_parser_init_declarator): When declaring (but not
1806 defining!) a function template in C++0x mode, check for default
1809 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1812 * decl.c (grokdeclarator): Deal with cv-qualified function type
1813 typedefs in the same way for member and non-member functions.
1815 2007-03-26 Dirk Mueller <dmueller@suse.de>
1817 * parser.c (cp_parser_member_declaration): Pedwarn
1818 about stray semicolons after member declarations.
1820 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1823 * pt.c (instantiate_decl): Set in_system_header.
1825 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1827 * cp-tree.h (current_tempalte_parms): Improve documentation.
1828 * pt.c (current_template_args): Likewise.
1831 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1832 not consume tokens when failing.
1834 2007-03-22 Jim Wilson <wilson@specifix.com>
1835 Mark Mitchell <mark@codesourcery.com>
1838 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1839 consistent with FROM.
1841 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1843 * error.c (dump_expr): Handle dependent names that designate types.
1844 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1846 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1848 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1850 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1852 * cvt.c (cp_convert_and_check) : Define.
1853 * cp-tree.h (cp_convert_and_check): Declare.
1854 * call.c (convert_conversion_warnings): Rename to
1855 conversion_null_warnings. The warning for floating-point to
1856 integer is handled by convert_and_check in convert_like_real.
1857 (convert_like_real): convert_conversion_warnings was renamed as
1858 conversion_null_warnings.
1859 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1860 overflow and changes of value during conversion.
1862 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1865 * parser.c (cp_parser_statement): If 'namespace' is found, this
1866 only can be a namespace alias definition, so parse it now.
1867 (cp_parser_namespace_alias_definition): if we find an open brace
1868 instead of '=', then this is actually a misplaced namespace
1871 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1874 * decl.c (cxx_init_decl_processing): Move command-line options
1875 processing to c-opts.c.
1877 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1879 * ptree.c (cxx_print_type): Use formatting markup for integers
1880 when printing template parameter index/level/orig level.
1881 (cxx_print_xnode): Ditto.
1882 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1883 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1884 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1886 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1887 rather than a HOST_WIDE_INT.
1888 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1889 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1891 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1892 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1893 IN_BASE_INITIALIZER bool bitfields.
1894 (struct cp_declarator): Make KIND a 4-bit field. Make
1895 PARAMETER_PACK_P a bool bitfield just after KIND.
1896 * pt.c (uses_parameter_packs): Destroy the pointer set.
1897 (make_pack_expansion): Ditto.
1898 (check_for_bare_parameter_packs): Ditto.
1899 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1901 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1904 * call.c (convert_default_arg): Instead of copying the node,
1907 2007-03-15 Dirk Mueller <dmueller@suse.de>
1910 * call.c (convert_conversion_warnings): New..
1911 (convert_like_real): .. factored out from here.
1912 (convert_conversion_warnings): Add warning about
1913 false being converted to NULL in argument passing.
1915 2007-03-14 Dirk Mueller <dmueller@suse.de>
1917 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1918 (finish_do_body): Warn about empty body in do/while statement.
1920 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1922 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1924 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1927 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1930 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1932 * cp/repo.c (init_repo): Initialize random_seed saved options.
1933 (finish_repo): Adjust.
1935 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1938 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1941 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1943 * decl.c (compute_array_index_type): New warning flag warn_vla.
1945 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1948 * call.c (convert_default_arg): Copy non-constant arguments.
1950 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1953 * parser.c (cp_parser_postfix_expression): Disallow compound
1954 literals in constant expressions.
1957 * semantics.c (finish_typeof): Use unlowered_expr_type.
1959 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1962 * cp-tree.h (unlowered_expr_type): New function.
1963 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1964 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1965 (unlowered_expr_type): New function.
1966 (build_unary_op): Disallow predecrements of bool bitfields.
1967 * call.c (build_conditional_expr): Use unlowered_expr_type.
1968 * pt.c (type_unification_real): Likewise.
1970 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1973 * typeck.c (check_return_expr): Check for bare parameter packs.
1974 (comptypes): Compare template parameter packs and
1975 type pack expansions.
1976 * decl.c (grokdeclarator): Deal with the declaration of function
1978 (grokparms): Verify that the (optional) function parameter pack is
1979 at the end of the parameter list.
1980 (xref_basetypes): Handle pack expansions in the base class.
1981 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1982 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1983 (NONTYPE_ARGUMENT_PACK): New.
1984 (TYPE_PACK_EXPANSION): New.
1985 (EXPR_PACK_EXPANSION): New.
1986 (ARGUMENT_PACK_SELECT): New.
1987 * cp-objcp-common.c (cp_tree_size): Compute size of
1988 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1989 ARGUMENT_PACK_SELECT.
1990 * error.c (dump_template_argument): Print template argument packs.
1991 (dump_template_argument_list): Ditto.
1992 (dump_template_parameter): Dump `...' for template type parameter
1994 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1995 (dump_parameters): Print function parameter packs.
1996 (dump_template_parms): Print template argument packs.
1997 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1998 (maybe_warn_variadic_templates): New.
1999 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2000 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2001 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2003 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2004 (write_template_arg): Write argument packs as separate arguments.
2005 * cp-tree.h (struct template_parm_index_s): Add flag that
2006 indicates that the template parameter is actually a parameter
2008 (struct tree_argument_pack_select): New.
2009 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2010 (union lang_tree_node): Add argument_pack_select.
2011 (FUNCTION_PARAMETER_PACK_P): New.
2012 (PACK_EXPANSION_P): New.
2013 (PACK_EXPANSION_PATTERN): New.
2014 (SET_PACK_EXPANSION_PATTERN): New.
2015 (PACK_EXPANSION_PARAMETER_PACKS): New.
2016 (ARGUMENT_PACK_P): New.
2017 (ARGUMENT_PACK_ARGS): New.
2018 (SET_ARGUMENT_PACK_ARGS): New.
2019 (ARGUMENT_PACK_INCOMPLETE_P): New.
2020 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2021 (TEMPLATE_PARM_PARAMETER_PACK): New.
2022 (TEMPLATE_TYPE_PARAMETER_PACK): New.
2023 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2024 (ARGUMENT_PACK_SELECT_INDEX): New.
2025 (ARGUMENT_PACK_SELECT_ARG): New.
2026 (struct cp_declarator): Add parameter_pack_p flag.
2027 (maybe_warn_variadic_templates): Declare.
2028 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2029 indicate a template parameter pack.
2030 (uses_parameter_packs): Declare.
2031 (template_parameter_pack_p): Declare.
2032 (template_parms_variadic_p): Declare.
2033 (make_pack_expansion): Declare.
2034 (check_for_bare_parameter_packs): Declare.
2035 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2036 sizeof... expressions.
2037 (pp_cxx_expression): Print pack expansions and non-type argument
2039 (pp_cxx_exception_specification): Print pack expansions.
2040 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2041 (pp_cxx_ctor_initializer): Print pack expansions.
2042 (pp_cxx_type_id): Print pack expansions.
2043 (pp_cxx_template_argument_list): Print argument packs.
2044 (pp_cxx_template_parameter): Print ellipsis for template parameter
2046 * pt.c (comp_template_parms): Compare template parameter packs.
2047 (template_parameter_pack_p): New.
2048 (template_parms_variadic_p): New.
2049 (template_args_variadic_p): New.
2050 (make_ith_pack_parameter_name): New.
2051 (struct find_parameter_pack_data): New.
2052 (find_parameter_packs_r): New.
2053 (uses_parameter_packs): New.
2054 (make_pack_expansion): New.
2055 (check_for_bare_parameter_packs): New.
2056 (expand_template_argument_pack): New.
2057 (reduce_template_parm_level): Propagate parameter pack flag.
2058 (process_template_parm): Add is_parameter_pack parameter to state
2059 when the parameter is actually a parameter pack. Create template
2060 parameter packs when is_parameter_pack is true.
2061 (current_template_args): The argument for a template parameter
2062 pack is an argument pack containing a single pack expansion.
2063 (process_partial_specialization): When checking that non-type
2064 argument expressions do not involve template parameters, loop over
2065 the arguments in argument packs separately.
2066 (push_template_decl_real): Check that the type of the declaration
2067 does not have any bare parameter packs. Check that primary
2068 templates have no more than one parameter pack, and that it comes
2069 at the end of the template parameter list.
2070 (convert_template_argument): Handle coercions for pack expansion
2071 expressions by coercing the pattern then rebuilding the expansion.
2072 (coerce_template_parms): When coercing the arguments for a
2073 variadic template, pack "extra" arguments into an argument pack.
2074 (coerce_template_template_parms): Cannot coerce between parameter
2075 packs and non-pack parameters.
2076 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2077 (comp_template_args): Expand all template arguments packs before
2078 comparing template argument lists.
2079 (mangle_class_name_for_template): Make argument packs as separate
2081 (for_each_template_parm_r): No need to handle BASELINK.
2082 (instantiate_class_template): Handle pack expansions in the base
2084 (tsubst_pack_expansion): New.
2085 (tsubst_template_args): Handle substitutions of argument packs and
2086 pack expansion into template argument lists.
2087 (tsubst_decl): Expand function parameter packs into separate
2088 function parameters.
2089 (tsubst_arg_types): Expand a type pack expansion into separate
2091 (tsubst_exception_specification): Handle pack expansions in
2092 exception specifiers.
2093 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2094 replacing a template parameter with its argument. If we encounter
2095 a substitution for an argument pack, just return the parameter
2097 (tsubst_copy): sizeof(X...) returns the number of elements in
2098 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2099 PARM_DECL is a parameter pack.
2100 (tsubst_expr): Expression pack expansions and argument packs
2101 cannot show up here; they will all be handled through function
2102 calls, sizeof, and template argument lists.
2103 (tsubst_copy_and_build): sizeof(X...) returns the number of
2104 elements in parameter pack X. Handle pack expansions in TREE_LIST
2105 and CONSTRUCTOR nodes.
2106 (fn_type_unification): Handle "incomplete" explicit template
2107 argument lists that specify some of the arguments for a template
2109 (type_unification_real): Unify arguments against pack expansions.
2110 (template_parm_level_and_index): New, helper function.
2111 (unify_pack_expansion): New.
2112 (unify): Unify argument packs on an argument-by-argument basis,
2113 handling variadic argument packs as well.
2114 (more_specialized_fn): Handle unification of function parameter
2115 packs. All things being equal, prefer non-variadic function
2116 templates to variadic function templates.
2117 (more_specialized_class): Prefer the variadic class template
2118 partial specialization that binds fewer arguments to a parameter
2120 (regenerate_decl_from_template): Expand function parameter packs
2121 into separate parameters.
2122 (instantiate_decl): Ditto.
2123 (tsubst_initializer_list): Handle pack expansions for base-class
2125 (dependent_type_p_r): Determine dependent types in argument packs
2126 and pack expansions.
2127 (value_dependent_expression_p): Determine value-dependence of
2128 non-type argument packs.
2129 (dependent_template_arg_p): Handle argument packs.
2130 * semantics.c (finish_cond): Check for bare parameter packs.
2131 (finish_expr_stmt): Ditto.
2132 (finish_for_expr): Ditto.
2133 (finish_switch_cond): Ditto.
2134 (finish_mem_initializers): Ditto.
2135 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2137 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2138 * parser.c (make_declarator): Declarator is not an expansion.
2139 (make_pointer_declarator): Transfer parameter pack flag to outer
2141 (make_reference_declarator): Ditto.
2142 (make_ptrmem_declarator): Ditto.
2143 (make_call_declarator): Ditto.
2144 (make_array_declarator): Ditto.
2145 (cp_parser_postfix_expression): Allow pack expansion expressions
2146 in the argument list for a call expression.
2147 (cp_parser_parenthesized_expression_list): Add new parameter
2148 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2149 into separate arguments."
2150 (cp_parser_new_placement): Allow pack expansion expressions.
2151 (cp_parser_new_initializer): Ditto.
2152 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2153 base-class initializer expansion.
2154 (cp_parser_mem_initializer): Ditto.
2155 (cp_parser_template_parameter_list): Keep track of whether the
2156 template parameter is a template parameter pack.
2157 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2158 template parameter pack.
2159 (cp_parser_type_parameter): Ditto.
2160 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2162 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2163 this declarator is a parameter pack.
2164 (cp_parser_parameter_declaration): The ellipsis does not end the
2165 parameter declaration, because it might be a parameter pack. Parse
2166 the ellipsis to indicate a parameter pack.
2167 (cp_parser_initializer): Allow pack expansions.
2168 (cp_parser_initializer_list): Allow ellipsis to create an
2169 initializer expansion.
2170 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2172 (cp_parser_type_id_list): Allow ellipsis to create an exception
2173 specifier expansion.
2174 (cp_parser_attribute_list): Don't allow pack expansions.
2175 (cp_parser_functional_cast): Allow pack expansions.
2176 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2177 compute the length of a parameter pack.
2178 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2179 end a template argument.
2180 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2181 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2184 2007-03-09 Dirk Mueller <dmueller@suse.de>
2186 * cp/call.c (build_new_op): Call warn_logical_operator.
2188 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2191 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2194 * pt.c (any_template_arguments_need_structural_equality_p):
2197 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2199 * decl.c (grokdeclarator): Disable warnings for anonymous
2202 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2204 * typeck2.c (readonly_error): Always emit a hard error.
2205 Remove last argument.
2206 * cp-tree.h (readonly_error): Adjust prototype.
2207 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2208 * typeck.c (build_unary_op): Likewise.
2209 (build_modify_expr): Likewise.
2211 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2214 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2216 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2219 * parser.c (struct cp_parser): New IN_IF_STMT.
2220 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2221 returning if parsing the body of an 'if' statement or issuing an
2222 error and continuing.
2223 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2225 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2227 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2230 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2233 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2235 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2236 Objective-C++. Don't exit early if -shared-libgcc needs to be
2239 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2241 * typeck.c (common_base_type): Delete unused function.
2243 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2245 * Make-lang.in: Add dummy lang.install-pdf target.
2247 2007-03-01 Simon Baldwin <simonb@google.com>
2250 * decl.c (check_tag_decl): Added new warning for typedef ignored
2251 when it precedes an otherwise valid non-typedef declaration.
2253 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2255 * typeck.c (build_function_call): Store converted arguments
2256 in a stack-allocated array instead of building a list.
2257 (convert_arguments): Store arguments in the array passed in as an
2258 argument, and return the actual number of arguments.
2259 * call.c (build_call): Delete, and replace with...
2260 (build_call_n, build_call_a): New.
2261 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2262 (build_over_call): Store converted arguments in a stack-allocated
2263 array instead of building a list.
2264 (build_cxx_call): Pass arguments in an array instead of as a list.
2265 (build_java_interface_fn_ref): Rewrite to avoid constructing
2267 * tree.h: Update declarations to reflect above changes.
2268 * method.c (use_thunk): Use a stack-allocated array to hold
2269 the arguments instead of a list.
2270 * rtti.c (throw_bad_cast): Update call to cxx_call.
2271 (throw_bad_typeid): Likewise.
2272 (build_dynamic_cast_1): Likewise.
2273 * init.c (build_builtin_delete_call): Use build_call_n.
2274 * decl.c (expand_static_init): Likewise.
2275 * except.c (cp_protect_cleanup_actions): Likewise.
2276 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2277 (gimplify_must_not_throw_expr): Likewise.
2278 (cxx_omp_apply_fn): Use build_call_a.
2280 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2282 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2283 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2285 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2287 * cp-tree.h (static_ctors): Remove.
2288 * cp-tree.h (static_dtors): Likewise.
2289 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2290 refactoring of tree_map hierarchy.
2291 (decl_shadowed_for_var_insert): Likewise.
2292 * semantics.c (expand_body): Use c_expand_body.
2293 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2294 * decl2.c (static_ctors): Remove.
2295 (static_dtors): Likewise.
2296 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2297 objc_generate_static_init_call. Do not call static_[cd]tors.
2298 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2300 (cp_write_global_declarations): Likewise.
2302 2007-02-23 Richard Guenther <rguenther@suse.de>
2304 * class.c (note_name_declared_in_class): Make declaration
2305 changes meaning a pedwarn.
2307 2007-02-22 Michael Matz <matz@suse.de>
2310 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2311 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2312 dump_function_decl): Guard emitting outer scopes by new flag.
2313 * cp-lang.c (cxx_dwarf_name): New function.
2314 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2315 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2317 (push_template_decl_real, lookup_template_class): Remove calls
2320 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2322 * call.c (build_new_method_call): Ensure that explicit calls of
2323 destructors have type "void".
2325 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2327 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2328 and -Walways-true with -Waddress.
2329 * cvt.c (convert_to_void): Replace unconditional warning with
2332 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2334 * decl.c, tree.c: Fix comment typos.
2336 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2339 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2340 statement expression if we had an error mark node.
2342 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2343 Brooks Moses <brooks.moses@codesourcery.com>
2344 Lee Millward <lee.millward@codesourcery.com>
2346 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2347 Change class to tcc_vl_exp.
2349 * call.c (build_call): Use build_call_list instead
2351 (build_over_call): Likewise.
2352 (build_new_method_call): Use build_min_non_dep_call_list
2353 instead of build_min_non_dep.
2355 * error.c (dump_call_expr_args): New function.
2356 (dump_aggr_init_expr_args): New function.
2357 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2358 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2360 * cvt.c (convert_to_void): Use build_call_array instead
2361 of build3; use new AGGR_INIT_EXPR accessor macros.
2363 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2364 instead of TREE_CODE_LENGTH.
2366 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2367 AGGR_INIT_EXPR accessor macros.
2369 * cp-gimplify.c (cp_gimplify_init_expr): Use
2370 AGGR_INIT_EXPR_SLOT to set the slot operand.
2372 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2373 (AGGR_INIT_EXPR_SLOT): New macro.
2374 (AGGR_INIT_EXPR_ARG): New macro.
2375 (aggr_init_expr_nargs): New macro.
2376 (AGGR_INIT_EXPR_ARGP): New macro.
2377 (aggr_init_expr_arg_iterator): New.
2378 (init_aggr_init_expr_arg_iterator): New.
2379 (next_aggr_init_expr_arg): New.
2380 (first_aggr_init_expr_arg): New.
2381 (more_aggr_init_expr_args_p): New.
2382 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2383 (stabilize_aggr_init): New declaration.
2384 (build_min_non_dep_call_list): Likewise.
2386 * tree.c (process_aggr_init_operands): New function.
2387 (build_aggr_init_array) New function.
2388 (build_cplus_new): Update to use new CALL_EXPR and
2389 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2390 build_aggr_init_array.
2391 (build_min_non_dep_call_list) New function.
2392 (build_min_nt): Assert input code parameter is not a variable
2393 length expression class.
2394 (build_min, build_min_non_dep): Likewise.
2395 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2396 to check for equality instead of recursing. Handle tcc_vl_exp
2398 (stabilize_call): Update to only handle CALL_EXPRs, not
2399 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2400 (stabilize_aggr_init): New function.
2401 (stabilize_init): Use it.
2403 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2404 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2405 AGGR_INIT_EXPR accessor macros and argument iterators.
2407 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2408 build_vl_exp. Iterate through the operands, recursively
2409 processing each one.
2410 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2411 CALL_EXPR accessor macros.
2412 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2413 tree code classes. Use TREE_OPERAND_LENGTH instead of
2416 * semantics.c (finish_call_expr): Use build_nt_call_list
2417 instead of build_nt.
2418 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2419 accessor macros. Use build_call_array to construct the
2420 CALL_EXPR node instead of build3
2422 * decl2.c (build_offset_ref_call_from_tree): Use
2423 build_nt_call_list and build_min_non_dep_call_list instead
2424 of build_min_nt and build_min_non_dep.
2426 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2427 Use build_nt_call_list instead of build_min_nt.
2429 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2432 * call.c (build_conditional_expr): Improve error message.
2434 2007-02-13 Dirk Mueller <dmueller@suse.de>
2436 * friend.c (do_friend): Annotate warning about friend
2437 declarations in templates with OPT_Wnon_template_friend.
2438 Convert informal message from warning() to inform().
2440 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2441 Mark Mitchell <mark@codesourcery.com>
2444 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2445 instantiations for variables.
2447 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2450 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2451 Check warn_unused_value just once.
2453 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2456 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2457 (fn_type_unificiation): Likewise.
2458 (get_bindings): Likewise.
2460 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2463 * decl.c (finish_function): Use DECL_REPLACEABLE.
2464 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2466 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2468 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2470 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2472 * decl.c (grokvardecl): Don't error if !have_tls.
2473 (grokdeclarator): Likewise.
2474 * parser.c (cp_parser_omp_threadprivate): Likewise.
2476 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2479 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2480 parameters and result decls in omp clauses.
2481 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2484 2007-02-05 Dirk Mueller <dmueller@suse.de>
2487 * parser.c (cp_parser_class_specifier): Always initialize bases.
2489 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2491 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2492 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2493 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2495 * semantics.c (finish_omp_atomic): Store a whole expression node
2496 in operand 1, and integer_zero_node in operand 0, for dependent
2497 OMP_ATOMIC. Rewrite to make flow easier to understand.
2499 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2501 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2503 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2505 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2506 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2508 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2510 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2511 keyword warning to -Wc++0x-compat.
2513 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2515 * decl.c (grokdeclarator): Update documentation.
2517 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2520 * decl.c (grokdeclarator): If __thread is used together with
2521 a storage class other than extern and static, clear thread_p
2522 after issuing diagnostics and fall through to checking the
2525 2007-01-30 Roger Sayle <roger@eyesopen.com>
2527 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2528 calculating the size of an array (to avoid recursive errors).
2530 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2533 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2535 * call.c (convert_like_real): Don't warn when converting to
2538 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2540 * decl.c (pop_label): Replace warning with call to
2541 warn_for_unused_label.
2543 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2546 * semantics.c (finish_pseudo_destructor_expr): Check the
2547 destrutor name by calling check_dtor_name.
2549 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2551 * lex.c (D_CPP0X): Rename.
2553 (reswords): D_CPP0X -> D_CXX0X.
2554 (init_reswords): Ditto.
2555 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2556 of C++0x keywords as identifiers.
2558 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2561 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2564 2007-01-23 Ian Lance Taylor <iant@google.com>
2566 * typeck.c (convert_for_assignment): Only warn about a = b = c
2567 when converting to bool.
2569 2007-01-23 Roger Sayle <roger@eyesopen.com>
2571 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2573 * typeck.c (ignore_overflows): Remove the remaining uses of
2574 TREE_CONSTANT_OVERFLOW.
2576 2007-01-20 Jan Hubicka <jh@suse.cz>
2578 * decl2.c (start_objects, start_static_storage_duration_function):
2579 Do not make the functions uninlinable.
2581 2007-01-17 Ian Lance Taylor <iant@google.com>
2583 * class.c (add_method): Call VEC_reserve_exact rather than passing
2584 a negative size to VEC_reserve.
2586 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2589 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2591 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2594 * decl.c (make_typename_type): If the qualified name is not a
2595 type, issue an error.
2596 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2599 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2601 * rtti.c: Include target.h.
2602 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2603 don't emit typeinfo for fundamental types as weak.
2604 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2606 2007-01-08 Richard Guenther <rguenther@suse.de>
2608 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2610 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2612 * call.c (standard_conversion): Pass flag to
2613 vector_types_convertible_p to disallow emission of note.
2614 * typeck.c (convert_for_assignment): Pass flag to
2615 vector_types_convertible_p to allow emission of note.
2616 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2617 to disallow emission of note.
2619 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2622 * typeck.c (build_binary_op): Call overflow_warning if
2623 TREE_OVERFLOW_P is true for the result and not for any of the
2626 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2629 * class.c (add_method): Don't wait until template
2630 instantiation time to complain about duplicate methods.
2632 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2635 * semantics.c (finish_unary_op_expr): Warn only if result
2636 overflowed and operands did not.
2638 2007-01-05 Ian Lance Taylor <iant@google.com>
2640 * typeck.c (build_binary_op): Warn about comparing a non-weak
2643 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2645 * pt.c (tsubst): Propagate the need for structural equality checks
2646 when reducing the level of template parameters.
2648 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2650 * pt.c: Fix a comment typo.
2652 2007-01-02 Ian Lance Taylor <iant@google.com>
2654 * semantics.c (maybe_convert_cond): Optionally warn when using an
2655 assignment as a condition.
2656 * typeck.c (convert_for_assignment): Optionally warn about
2657 assigning the result of an assignment to a bool.
2659 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2661 * pt.c (canonical_template_parms): Correct typo in comment.
2663 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2665 * typeck.c (structural_comptypes): Renamed from "comptypes".
2666 (comptypes): Use canonical type information to perform fast type
2667 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2668 canonical type comparison returns the same results as we would see
2669 from the current, structural check. Support COMPARE_STRUCTURAL
2670 when we need structural checks.
2671 * decl.c (typename_compare): Fix comment.
2672 (build_typename_type): TYPENAME_TYPE nodes require structural
2673 equality checks, because they resolve different based on the
2675 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2676 require structural equality checks (for now).
2677 (build_ptrmemfunc_type): Build the canonical pointer to member
2679 (compute_array_index_type): Whenever we build a new index type
2680 to represent the size of an array in a template, we need to mark
2681 this index type as requiring structural equality. This goes for
2682 arrays with value-dependent sizes with the current ABI, or all
2684 * tree.c (cplus_array_hash): New.
2685 (struct cplus_array_info): New.
2686 (cplus_array_compare): New.
2687 (cplus_array_htab): New.
2688 (build_cplus_array_type_1): Use a hash table to cache the array
2689 types we build. Build the canonical array type for each array
2691 (cp_build_qualified_type_real): When building a cv-qualified array
2692 type, use the hash table of array types and build canonical array
2694 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2695 use structural equality (for now).
2696 * cp-tree.h (COMPARE_STRUCTURAL): New.
2697 * pt.c (canonical_template_parms): New.
2698 (canonical_type_parameter): New.
2699 (process_template_parm): Find the canonical type parameter.
2700 (lookup_template_class): When we have named the primary template
2701 type, set the canonical type for our template class to the primary
2702 template type. If any of the template arguments need structural
2703 equality checks, the template class needs structural equality
2705 (tsubst): When reducing the level of a template template
2706 parameter, we require structural equality tests for the resulting
2707 parameter because its template parameters have not had their types
2708 canonicalized. When reducing a template type parameter, find the
2709 canonical reduced type parameter.
2710 (any_template_arguments_need_structural_equality_p): New.