1 2007-10-14 Andrew Pinski <pinskia@gmail.com>
4 * decl.c (grokfndecl): Return NULL after the "definition of
5 implicitly-declared" error happened.
7 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
10 * call.c (build_user_type_conversion_1): Do not consider conversion
11 functions to convert a (possibly cv-qualified) object to the (possibly
12 cv-qualified) same object type (or a reference to it), to a (possibly
13 cv-qualified) base class of that type (or a reference to it).
15 2007-10-12 Paolo Carlini <pcarlini@suse.de>
17 * pt.c (tsubst): Use template_parm_level_and_index.
19 2007-10-12 Jakub Jelinek <jakub@redhat.com>
22 * parser.c (cp_parser_compound_statement): Handle label-declarations
23 at the beginning of the compound statement.
24 (cp_parser_block_declaration): Issue diagnostics about __label__
25 not at the beginning of a block.
27 2007-10-11 Paolo Carlini <pcarlini@suse.de>
30 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
31 to convert_template_argument.
32 (coerce_template_parms): Return error_mark_node after fixed-length
34 (tsubst_decl): Check for error_mark_node the return value of the
35 first tsubst in 'case VAR_DECL'.
37 2007-10-08 Ollie Wild <aaw@google.com>
39 * typeck2.c (digest_init): Call cplus_expand_constant after
40 convert_for_initialization.
41 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
42 * expr.c (cplus_expand_constant): Updated function description.
44 2007-10-04 Jason Merrill <jason@redhat.com>
47 * call.c (initialize_reference): Handle local static reference
50 2007-10-03 Jason Merrill <jason@redhat.com>
53 * name-lookup.c (push_namespace_with_attrs): Fold back into...
54 (push_namespace): Here.
55 (handle_namespace_attrs): New fn for the attr code.
56 (leave_scope): Don't pop_visibility.
57 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
58 * parser.c (cp_parser_namespace_definition): Call
59 handle_namespace_attrs and pop_visibility as appropriate.
62 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
64 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
66 * decl.c (duplicate_decls): Preserve linkage flags for mere
67 redeclarations of gnu_inline definitions.
69 2007-10-03 Jason Merrill <jason@redhat.com>
72 * decl.c (wrap_cleanups_r): New fn.
73 (wrap_temporary_cleanups): New fn.
74 (initialize_local_var): Call it.
76 2007-09-29 Jason Merrill <jason@redhat.com>
79 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
80 constant to not have DECL_EXTERNAL if it's file-local.
82 2007-09-28 Ollie Wild <aaw@google.com>
85 2007-09-27 Ollie Wild <aaw@google.com>
87 * typeck2.c (digest_init): Call cplus_expand_constant after
88 convert_for_initialization.
89 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
90 * expr.c (cplus_expand_constant): Updated function description.
92 2007-09-28 Jason Merrill <jason@redhat.com>
95 * class.c (layout_empty_base): Take rli parameter, update
96 rli->record_align if empty base has user-specified alignment.
97 (build_base_field): Pass rli to it.
99 2007-09-28 Paolo Carlini <pcarlini@suse.de>
102 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
104 2007-09-28 Paolo Carlini <pcarlini@suse.de>
107 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
108 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
109 (dump_parameters): Just call dump_type for argument packs too.
111 2007-09-28 Jakub Jelinek <jakub@redhat.com>
114 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
115 qualification by creating qualified PACK_EXPANSION_PATTERN and
116 then calling make_pack_expansion on it.
118 2007-09-27 Ollie Wild <aaw@google.com>
120 * typeck2.c (digest_init): Call cplus_expand_constant after
121 convert_for_initialization.
122 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
123 * expr.c (cplus_expand_constant): Updated function description.
125 2007-09-27 Jason Merrill <jason@redhat.com>
128 * decl2.c (is_late_template_attribute): Don't crash on unknown
131 2007-09-27 Paolo Carlini <pcarlini@suse.de>
134 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
135 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
136 spaces in the formatting.
137 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
139 2007-09-27 Jakub Jelinek <jakub@redhat.com>
141 * error.c (cxx_print_error_function): Add third argument, pass
142 it over to lhd_print_error_function.
143 (cp_print_error_function): If diagnostic->abstract_origin, print
145 * cp-tree.h (struct diagnostic_info): New forward decl.
146 (cxx_print_error_function): Add third argument.
148 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
151 * name-lookup.c (pushtag): Do not create an implicit typedef before
152 the associated type declaration is known to be valid.
154 2007-09-25 Jakub Jelinek <jakub@redhat.com>
156 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
157 rather than pointers.
159 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
162 * search.c (check_final_overrider): Fail if
163 targetm.comp_type_attributes returns 0.
165 2007-09-24 Jason Merrill <jason@redhat.com>
168 * pt.c (resolve_typename_type): Don't look things up in the original
169 template if it would mean losing template arguments.
171 2007-09-24 Jakub Jelinek <jakub@redhat.com>
174 * cp-tree.h (cxx_type_hash_eq): New prototype.
175 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
176 * tree.c (cxx_type_hash_eq): New function.
178 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
181 * tree.c (cp_build_qualified_type_real): Build a canonical
182 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
184 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
188 * tree.c (cplus_array_compare): Compare pointers, not types.
189 (build_cplus_array_type_1): Store new array type into the hash
190 table before building the canonical type; build the canonical type
192 (cp_build_qualified_type_real): Put all of the array types with
193 cv-qualified element types into the C++ array hash table, built as
194 variants of the unqualified versions.
196 2007-09-23 Jason Merrill <jason@redhat.com>
199 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
200 for deprecation warnings.
202 2007-09-22 Jason Merrill <jason@redhat.com>
205 * call.c (build_over_call): Warn about deprecated virtuals.
208 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
209 (MAYBE_TAGGED_TYPE_P): Remove.
210 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
211 instead of calling is_late_template_attribute again.
212 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
213 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
214 Don't crash on typedefs from non-template classes.
215 * decl2.c (grokfield): Don't sorry about attrs on template parms.
216 (is_late_template_attribute): All attributes applied to template
217 parms or typename types are dependent. Static.
218 (splice_template_attributes): Pass decl through.
219 (save_template_attributes): Likewise.
221 2007-09-20 Jakub Jelinek <jakub@redhat.com>
224 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
225 returned from tsubst_pack_expansion.
226 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
227 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
229 2007-09-20 Paolo Carlini <pcarlini@suse.de>
232 * semantics.c (finish_id_expression): Use consistently
233 context_for_name_lookup.
234 * decl.c (fixup_anonymous_aggr): Fix error message for
235 anonymous struct (vs union).
237 2007-09-19 Jason Merrill <jason@redhat.com>
240 * pt.c (tsubst): Handle typedefs by looking for the specialization.
241 (retrieve_specialization): Only tagged types use
242 DECL_TEMPLATE_INSTANTIATIONS.
243 (instantiate_class_template): Push nested classes too.
244 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
246 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
247 * init.c (is_aggr_type): Remove redundant tests.
248 * class.c (push_nested_class): Use CLASS_TYPE_P.
250 2007-09-20 Paolo Carlini <pcarlini@suse.de>
253 * init.c (build_zero_init): If, recursively, build_zero_init
254 returns a NULL_TREE, do not append it to the VEC of constructors.
256 2007-09-18 Jason Merrill <jason@redhat.com>
259 * pt.c (apply_late_template_attributes): Set processing_template_decl.
260 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
261 ATTR_FLAG_TYPE_IN_PLACE.
262 (tsubst): Do unqualified lookup to find typedefs from current class.
263 [ARRAY_TYPE]: Propagate alignment info.
264 * decl2.c (is_late_template_attribute): Only defer handling of
265 attribute aligned if the expression is dependent.
266 (save_template_attributes): If we're deferring any attributes,
267 make this a naming typedef.
269 2007-09-18 Paolo Carlini <pcarlini@suse.de>
272 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
273 va_arg instead of __builtin_va_arg.
275 2007-09-18 Paolo Carlini <pcarlini@suse.de>
278 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
279 (pp_cxx_primary_expression): Use it.
280 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
281 * error.c (dump_expr): Use it.
283 2007-09-18 Paolo Carlini <pcarlini@suse.de>
286 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
287 out case TYPEID_EXPR to...
288 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
289 and pp_cxx_right_paren.
290 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
291 * error.c (dump_expr): Use it.
293 2007-09-18 Paolo Carlini <pcarlini@suse.de>
296 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
297 (pp_cxx_primary_expression): Use it.
298 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
299 * error.c (dump_expr): Use it.
301 2007-09-16 Paolo Carlini <pcarlini@suse.de>
304 * init.c (build_new): Remove warning for zero-element
307 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
310 * call.c (maybe_handle_implicit_object): Set this_p, clear
311 rvaluedness_matches_p.
312 (compare_ics): Do not compare rvaluedness matching when one of the
313 operands is an implicit object.
315 2007-09-14 Jason Merrill <jason@redhat.com>
317 PR c++/17743, c++/19163
318 * decl2.c (is_late_template_attribute): New fn.
319 (splice_template_attributes, save_template_attributes): New fns.
320 (cplus_decl_attributes): Call save_template_attributes.
321 * pt.c (apply_late_template_attributes): New fn.
322 (instantiate_class_template, tsubst_decl): Use it.
323 * cp-tree.h: Declare is_late_template_attribute.
325 2007-09-13 Tom Tromey <tromey@redhat.com>
327 * parser.c (cp_lexer_new_main): Don't use
328 c_lex_return_raw_strings.
329 (cp_lexer_get_preprocessor_token): Update. Add special case when
332 2007-09-11 Jan Hubicka <jh@suse.cz>
334 * method.c (use_thunk): Use tree_rest_of_compilation
335 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
336 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
337 * cp-tree.h (expand_body): Kill.
338 (emit_associated_thunks): Declare.
339 * semantics.c (emit_associated_thunks): Export.
342 2007-09-09 David Daney <ddaney@avtrex.com>
345 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
346 to calculate cookie_ptr.
348 2007-09-08 Jason Merrill <jason@redhat.com>
351 * pt.c (most_specialized_class): Set processing_template_decl
352 while tsubsting partial spec args.
354 2007-09-06 Jason Merrill <jason@redhat.com>
356 * decl2.c (get_guard): Copy visibility from the guarded variable.
358 2007-09-06 Jan Hubicka <jh@suse.cz>
360 * semantics.c (expand_body): Do not mark arguments of clones used.
362 2007-09-06 Paolo Carlini <pcarlini@suse.de>
365 * decl.c (cp_finish_decl): When processing_template_decl,
366 deal correctly with init as TREE_LIST.
368 2007-09-06 Tom Tromey <tromey@redhat.com>
370 * decl.c (finish_function): Put return's location on line zero of
373 2007-09-05 Jason Merrill <jason@redhat.com>
376 * except.c (prepare_eh_type): Use type_decays_to.
379 * init.c (build_delete): Use build_headof to get the address of the
380 complete object if we aren't using the deleting destructor.
381 * rtti.c (build_headof): No longer static.
382 * cp-tree.h: Declare it.
384 2007-09-06 Jakub Jelinek <jakub@redhat.com>
386 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
387 decl if a prototype for XX is provided with throw().
390 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
391 on __*_chk non-__builtin_* decls.
393 2007-09-05 Paolo Carlini <pcarlini@suse.de>
396 * semantics.c (finish_id_expression): Use context_for_name_lookup
397 insted of DECL_CONTEXT, to see through anonymous structs and unions.
398 * class.c (finish_struct_anon): Deal correctly with anonymous
399 structs (vs unions, as GNU extension) in error messages.
401 2007-09-05 Jan Hubicka <jh@suse.cz>
403 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
404 call, DECL_EXTERNAL checks and current_function_decl saving.
406 2007-09-05 Paolo Carlini <pcarlini@suse.de>
409 * parser.c (cp_parser_primary_expression): Return error_mark_node
410 when a statement-expression is found in a template-argument list.
412 2007-09-04 Jason Merrill <jason@redhat.com>
414 * except.c (initialize_handler_parm): Use
415 fold_build_cleanup_point_expr.
418 * call.c (reference_binding): Don't look for user-defined conversions
422 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
423 the MUST_NOT_THROW_EXPR.
425 2007-09-04 Richard Sandiford <richard@codesourcery.com>
427 * decl.c (cp_finish_decl): Call determine_visibility before
428 make_rtl_for_nonlocal_decl.
430 2007-09-04 Jason Merrill <jason@redhat.com>
433 * pt.c (most_specialized_class): Substitute outer template
434 arguments into the arguments of a member template partial
436 (strip_innermost_template_args): New fn.
438 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
440 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
442 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
444 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
445 * decl.c (cp_make_fname_decl): Likewise,
446 * parser.c (cp_parser_string_literal): Likewise,
447 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
448 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
451 2007-09-02 Paolo Carlini <pcarlini@suse.de>
454 * typeck.c (build_unary_op): Fix error message for
455 Boolean expression as operand to operator--.
457 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
459 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
460 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
463 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
466 * init.c (build_default_init): Make extern.
467 * cp-tree.h (build_default_init): Declare here.
468 * pt.c (tsubst_expr): When the instantiation of the initializer of
469 a variable results in an empty list, default-initialize the
471 (tsubst_copy_and_build): When the instantiation of the initializer
472 in a new expression results in an empty initializer list,
473 default-initialize it.
475 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
477 * mangle.c (write_type): Change mangling of rvalue reference from
480 2007-08-31 Jakub Jelinek <jakub@redhat.com>
482 * decl.c (duplicate_decls): Remove duplicated line.
484 2007-08-31 Paolo Carlini <pcarlini@suse.de>
487 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
488 BOUND_TEMPLATE_TEMPLATE_PARM.
490 2007-08-31 Paolo Carlini <pcarlini@suse.de>
493 * search.c (lookup_member): Check the name argument for
496 2007-08-31 Paolo Carlini <pcarlini@suse.de>
499 * parser.c (cp_parser_trait_expr): Check rerurn value of
502 2007-08-30 Ollie Wild <aaw@google.com>
504 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
505 convert_ptrmem for pointer to member conversions.
506 (convert_to_pointer_force): Update cp_convert_to_pointer call.
507 (ocp_convert): Update cp_convert_to_pointer call.
508 * typeck.c (convert_ptrmem): Add conditional for null pointers to
510 (build_static_cast_1): Check can_convert for conversions in either
512 (get_delta_difference_1): New function.
513 (get_delta_difference): Refactor to call get_delta_difference_1.
515 2007-08-30 Jakub Jelinek <jakub@redhat.com>
517 * decl.c (start_preparsed_function): Set
518 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
520 2007-08-28 Paolo Carlini <pcarlini@suse.de>
523 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
524 BOUND_TEMPLATE_TEMPLATE_PARM.
526 2007-08-28 Jakub Jelinek <jakub@redhat.com>
530 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
531 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
533 2007-08-27 Jason Merrill <jason@redhat.com>
536 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
537 Look inside STMT_EXPR.
538 * semantics.c (stmt_expr_value_expr): New fn.
539 * cp-tree.h: Declare it.
542 * decl.c (groktypename): Ignore attributes applied to class type.
544 2007-08-28 Richard Guenther <rguenther@suse.de>
546 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
548 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
550 * error.c (dump_expr): Handle COMPLEX_CST.
551 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
552 (pp_cxx_expression): Likewise.
554 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
556 * decl.c (GNU_INLINE_P): New.
557 (duplicate_decls): Handle gnu_inline. Merge attributes and
558 some flags in overriding definitions.
559 (redeclaration_error_message): Handle gnu_inline.
560 (start_preparsed_function): Likewise.
562 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
564 * call.c (sufficient_parms_p): Constify.
565 * class.c (same_signature_p): Likewise.
566 * cp-gimplify.c (is_invisiref_parm,
567 cxx_omp_privatize_by_reference): Likewise.
568 * cp-objcp-common.c (has_c_linkage): Likewise.
569 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
570 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
571 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
572 num_artificial_parms_for, comp_template_parms,
573 template_parameter_pack_p, any_dependent_template_arguments_p,
574 any_type_dependent_arguments_p, any_value_dependent_elements_p,
575 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
576 zero_init_p, member_p, cp_lvalue_kind,
577 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
578 varargs_function_p, is_dummy_object, special_function_kind,
579 string_conv_p, type_unknown_p, comp_except_specs, compparms,
580 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
581 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
582 cp_has_mutable_p, at_least_as_qualified_p,
583 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
584 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
585 * except.c (nothrow_libfn_p): Likewise.
586 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
588 * pt.c (comp_template_parms, template_parameter_pack_p,
589 any_type_dependent_arguments_p, any_value_dependent_elements_p,
590 any_dependent_template_arguments_p): Likewise.
591 * repo.c (repo_export_class_p): Likewise.
592 * semantics.c (anon_aggr_type_p): Likewise.
593 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
594 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
595 varargs_function_p, member_p, is_dummy_object, pod_type_p,
596 zero_init_p, special_function_p): Likewise.
597 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
598 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
599 compparms, invalid_nonstatic_memfn_p,
600 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
601 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
602 cp_has_mutable_p, lvalue_or_else): Likewise.
604 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
606 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
607 * cp-objcp-common.c (cp_tree_size): Ditto.
608 * tree.c (cp_walk_subtrees): Ditto
609 * cp-tree.def (TINST_LEVEL): Go away.
610 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
611 move together with other non-tree structs.
612 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
613 (union lang_tree_node): Eliminate tinst_level field.
614 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
615 (current_instantiation, outermost_tinst_level): Return
616 a "struct tinst_level *".
618 * error.c (print_instantiation_partial_context): Change second
619 parameter to a "struct tinst_level *". Replace accessor macros
621 (print_instantiation_full_context): Likewise.
622 * lex.c (in_main_input_context): Likewise.
624 * pt.c (struct pending_templates): New.
625 (pending_templates, last_pending_template): Use it as a type.
626 (current_tinst_level): Change typo to "struct tinst_level *"
627 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
628 (add_pending_template): Construct a "struct pending_template".
629 Replace TINST_LEVEL accessor macros with field access.
630 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
631 (pop_tinst_level): Likewise.
632 (instantiate_pending_templates): Likewise. Factor common code used
633 when an instantiation has been done.
634 (outermost_tinst_level): Replace tree_last with loop.
635 (current_instantiation): Return a "struct tinst_level *".
637 2007-08-24 Ollie Wild <aaw@google.com>
639 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
640 * name-lookup.h (cp_binding_level): Remove vtables member.
642 2007-08-24 Richard Guenther <rguenther@suse.de>
644 * tree.c (cp_cannot_inline_tree_fn): Remove.
645 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
646 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
649 2007-08-24 Jakub Jelinek <jakub@redhat.com>
652 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
653 error_mark_node right away if build_expr_type_conversion
657 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
658 is error_mark_node rather than NULL_TREE.
659 * pt.c (check_explicit_specialization): Likewise.
662 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
663 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
665 2007-08-22 Jason Merrill <jason@redhat.com>
668 * pt.c (outermost_tinst_level): New function.
669 * lex.c (in_main_input_context): New function.
670 * cp-tree.h: Declare it.
671 * decl2.c (constrain_class_visibility): Use it to avoid warning
672 about uses of the anonymous namespace in the main input file.
674 2007-08-21 Jakub Jelinek <jakub@redhat.com>
676 * init.c (build_new_1): Use get_target_expr instead of save_expr.
678 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
681 * class.c (finish_struct_1): Warn when a class has virtual
682 functions and accessible non-virtual destructor.
684 2007-08-20 Richard Guenther <rguenther@suse.de>
688 * call.c (build_new_method_call): Convert initializer to
690 * init.c (build_aggr_init): Do not fiddle with types.
691 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
692 * except.c (build_throw): Do not drop qualifiers for the
694 * typeck.c (get_member_function_from_ptrfunc): Do not
695 fiddle with types, instead convert.
696 (build_ptrmemfunc1): Convert to the target type for
698 (gfc_trans_allocate): Convert result to target type.
699 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
700 pointer-to-member structures shall have alias set zero as well.
702 2007-08-20 Richard Guenther <rguenther@suse.de>
704 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
706 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
707 (nonstatic_local_decl_p): Likewise.
708 * tree.c (cp_auto_var_in_fn_p): Remove.
709 * decl.c (nonstatic_local_decl_p): Remove.
711 2007-08-20 Richard Guenther <rguenther@suse.de>
713 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
715 * tree.h (cp_walk_tree): New define to walk_tree_1 with
716 cp_walk_subtrees lh parameter.
717 (cp_walk_tree_without_duplicates): New define to
718 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
719 * tree.c (count_trees): Call
720 cp_walk_tree_without_duplicates.
721 (verify_stmt_tree): Call cp_walk_tree.
722 (break_out_target_exprs): Likewise.
723 (WALK_SUBTREE): Likewise.
724 * cp-gimplify.c (cp_genericize): Likewise.
725 * cp-pt.c (find_parameter_packs_r): Likewise.
726 (uses_parameter_packs): Likewise.
727 (make_pack_expansion): Likewise.
728 (check_for_bare_parameter_packs): Likewise.
729 (for_each_template_parm): Likewise.
730 * decl.c (check_default_argument): Call
731 cp_walk_tree_without_duplicates.
732 * except.c (build_throw): Likewise.
733 * decl2.c (type_visibility): Likewise.
734 * semantics.c (expand_or_defer_fn): Likewise.
735 (finalize_nrv): Call cp_walk_tree.
737 2007-08-20 Jakub Jelinek <jakub@redhat.com>
740 * init.c (build_new_1): Rename placement_var variable to placement_expr.
741 Initialize it with save_expr rather than get_temp_regvar.
743 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
746 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
749 2007-08-17 Ollie Wild <aaw@google.com>
752 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
753 declarations into appropriate slots for comparison. Fix type
756 2007-08-17 Paolo Carlini <pcarlini@suse.de>
759 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
760 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
762 2007-08-17 Paolo Carlini <pcarlini@suse.de>
765 * parser.c (cp_parser_class_head): Improve error message.
767 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
769 * pt.c (instantiate_decl): Set input_location
770 for the function end.
772 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
774 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
776 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
777 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
778 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
779 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
780 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
781 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
782 * typeck.c (cp_type_quals): Likewise.
783 * typeck2.c (cxx_incomplete_type_diagnostic,
784 cxx_incomplete_type_error): Likewise.
786 2007-08-16 Paolo Carlini <pcarlini@suse.de>
789 * pt.c (tsubst_friend_function): When check_classfn
790 returns error_mark_node likewise return it.
792 2007-08-15 Jakub Jelinek <jakub@redhat.com>
795 * typeck.c (check_return_expr): Don't NRV optimize vars in
797 * decl.c (finish_function): Comment fix.
799 2007-08-15 Paolo Carlini <pcarlini@suse.de>
802 * pt.c (push_template_decl_real): Depending on TYPE_P
803 use either TYPE_CONTEXT or DECL_CONTEXT.
805 2007-08-14 Mark Mitchell <mark@codesourcery.com>
807 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
808 constructors and destructors return this.
810 2007-08-14 Paolo Carlini <pcarlini@suse.de>
813 * decl2.c (check_classfn): Return error_mark_node in case of error;
814 in that case, do not call add_method.
815 * decl.c (start_decl): Deal with check_classfn returning
817 (grokfndecl): Likewise.
818 * pt.c (tsubst_friend_function): Likewise.
820 2007-08-14 Andrew Pinski <pinskia@gmail.com>
823 * typeck.c (build_binary_op): Disallow vector float types with
824 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
826 2007-08-11 Ian Lance Taylor <iant@google.com>
828 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
830 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
832 2007-08-10 Ollie Wild <aaw@google.com>
834 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
836 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
838 (unqualified_namespace_lookup): Fix ambiguous_decl call.
839 (lookup_using_namespace): Fix ambiguous_decl call.
840 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
842 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
844 * call.c (name_as_c_string): Use CONST_CAST.
845 * decl.c (build_decl): Likewise.
846 * parser.c (cp_parser_string_literal): Likewise.
848 2007-08-10 Paolo Carlini <pcarlini@suse.de>
851 * error.c (dump_expr): Consistently use the *_cxx_*
852 variants of the pretty-print functions.
854 2007-08-10 Paolo Carlini <pcarlini@suse.de>
857 * decl.c (check_special_function_return_type): Just error
858 on return type specified for conversion operator.
860 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
862 * typeck2.c (readonly_error): Handle general expressions.
863 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
865 2007-08-06 Dan Hipschman <dsh@google.com>
867 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
868 access function name.
870 2007-08-04 Alfred Minarik <a.minarik@aon.at>
873 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
874 * g++spec.c (lang_specific_driver): Check them.
876 2007-08-06 Paolo Carlini <pcarlini@suse.de>
879 * pt.c (inline_needs_template_parms): Fix comment; change return type
882 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
885 2007-03-26 Dirk Mueller <dmueller@suse.de>
887 * parser.c (cp_parser_member_declaration): Pedwarn
888 about stray semicolons after member declarations.
890 2007-08-02 Lee Millward <lee.millward@gmail.com>
895 * parser.c (cp_parser_asm_definition): Detect and discard asm
896 statements with invalid inputs or outputs.
897 (cp_parser_asm_operand_list): Return error mark node if any
898 of the operands are invalid. Adjust documentation.
900 2007-08-02 Nick Clifton <nickc@redhat.com>
902 * typeck.c: Change copyright header to refer to version 3 of the
903 GNU General Public License and to point readers at the COPYING3
904 file and the FSF's license web page.
905 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
906 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
907 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
908 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
909 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
910 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
911 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
912 name-lookup.h, parser.c: Likewise.
914 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
917 * call.c (magic_varargs_p): Honor the "type generic" attribute.
919 2007-07-30 Paolo Carlini <pcarlini@suse.de>
922 * semantics.c (finish_label_stmt): Reject the __label__
923 extension outside function scopes.
925 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
927 * parser.c (eof_token): Un-constify.
928 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
929 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
932 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
934 * pt.c, tree.c, typeck2.c: Fix comment typos.
936 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
937 Mark Mitchell <mark@codesourcery.com>
940 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
941 hidden due to friend declarations in local classes.
943 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
945 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
946 * cp-tree.def (DECLTYPE_TYPE): New.
947 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
948 (dump_type_prefix): Ditto.
949 (dump_type_suffix): Ditto.
950 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
951 * mangle.c (write_type): Handle DECLTYPE_TYPE.
952 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
954 (DECLTYPE_TYPE_EXPR): New.
955 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
956 (finish_declared_type): Declare.
957 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
959 (pp_cxx_type_id): Ditto.
960 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
961 (tsubst): Substitute into a DECLTYPE_TYPE node.
962 (tsubst_copy): Ditto.
963 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
965 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
966 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
967 structural equality (because we can't hash the expressions).
968 (finish_declared_type): New.
969 * lex.c (reswords): Add "decltype" keyword.
970 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
971 (cp_parser_postfix_expression): Add member_access_only_p to
972 restrict postfix expression to member access expressions.
973 (cp_parser_unary_expression): Update call to
974 cp_parser_postfix_expression to reflect new parameter.
975 (cp_parser_declared_type): New.
976 (cp_parser_simple_type_specifier): Parse decltype types.
978 2007-07-27 Mark Mitchell <mark@codesourcery.com>
981 * call.c (convert_for_arg_passing): Only widen bitfields to their
982 declared types if necessary.
984 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
986 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
989 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
991 * decl.c (typename_hash, typename_compare): Constify.
992 * mangle.c (hash_type, compare_type): Likewise.
993 * pt.c (eq_local_specializations, hash_local_specialization):
995 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
996 list_hash): Likewise.
997 * typeck2.c (pat_compare): Likewise.
999 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
1001 * method.c (implicitly_declare_fn): Increase alignment if member
1002 function pointer format requires it.
1004 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1007 * typeck.c (check_return_expr): Do not pass a null argument
1010 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1013 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1016 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1019 * typeck.c (convert_arguments): Only use default args if we have
1023 * typeck.c (structural_comptypes): No need to check
1024 resolve_typename_type return value here.
1025 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1026 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1027 original type rather than error_mark_node in case of failure.
1028 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1029 resolve_typename_type result check.
1030 (cp_parser_direct_declarator, cp_parser_head,
1031 cp_parser_constructor_declarator_p): Likewise.
1033 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1035 * pt.c (template_parms_variadic_p): Remove.
1036 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1038 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1041 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1042 argument to dump_aggr_init_expr_args instead of false.
1044 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1046 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1047 canonical types; otherwise, fall back to structural type
1048 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1049 internal compiler error if the canonical types are wrong.
1051 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1054 * parser.c (cp_parser_make_indirect_declarator): When the
1055 the code argument is ERROR_MARK return cp_error_declarator.
1057 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1060 * decl.c (cxx_init_decl_processing): Don't set
1061 force_align_functions_log.
1062 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1063 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1064 FUNCTION_DECL, return its alignment.
1066 2007-07-09 Richard Guenther <rguenther@suse.de>
1068 * decl.c (start_preparsed_function): Do not promote return type.
1070 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1073 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1075 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1078 * pt.c (resolve_overloaded_unification): Robustify. Return a
1080 (type_unification_real): Adjust accordingly.
1082 2007-07-06 Richard Guenther <rguenther@suse.de>
1084 * init.c (build_new_1): Use the correct pointer type.
1085 * typeck2.c (build_m_component_ref): Likewise.
1087 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1090 * init.c (build_zero_init): Always build an initializer for
1092 * typeck2.c (build_functional_cast): Use build_zero_init.
1095 * init.c (build_new_1): Always pass the allocation function to
1096 build_op_delete_call.
1097 * call.c (build_op_delete_call): Handle operator delete with a
1098 variable-argument list. Do not issue an error when no matching
1099 deallocation function is available for a new operator.
1102 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1103 * decl.c (value_dependent_init_p): New function.
1104 (cp_finish_decl): Use it.
1105 * pt.c (value_dependent_expression_p): Use
1106 any_value_dependent_elements_p.
1107 * parser.c (cp_parser_primary_expression): Add comment about
1108 treating dependent qualified names as integral
1109 constant-expressions.
1111 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1113 * decl.c (build_ptrmemfunc_type): Always use structural equality
1114 tests when comparing pointer-to-member-function types, because the
1115 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1118 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1120 * init.c (build_new): Tweak comment.
1122 2007-06-29 Dave Brolley <brolley@redhat.com>
1125 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1126 type to its base type and number of elements here.
1127 * init.c (build_new): Call complete_type_or_else to ensure that the
1128 type is complete and to issue a diagnostic if it is not.
1129 (build_new_1): Don't call complete_type_or_else here.
1131 2007-07-03 Richard Guenther <rguenther@suse.de>
1134 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1137 2007-07-02 Simon Baldwin <simonb@google.com>
1139 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1140 for inner-style nested forward declarations that don't declare
1143 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1146 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1147 DECL_P in not a variable and appears more than once error messages.
1149 2007-07-01 Ollie Wild <aaw@google.com>
1151 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1152 (select_decl): Remove function.
1153 (unqualified_namespace_lookup): Populate binding by calling
1154 ambiguous_decl. Remove select_decl call.
1155 (lookup_qualified_name): Remove select_decl call.
1156 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1157 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1158 generation when name lookup is ambiguous.
1160 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1163 * init.c (build_new_1): Use structural equality on the copy of the
1166 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1168 * decl2.c (determine_visibility): Implement
1169 flag_visibility_ms_compat effect on type info.
1170 * decl.c (cxx_init_decl_processing): Implement
1171 global effect of flag_visibility_ms_compat.
1173 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1175 * decl2.c (start_objects): Mark constructor-running function
1178 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1181 * decl.c (grokdeclarator): Reset friendp for member functions declared
1182 friend of their own class.
1184 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1186 * decl2.c (determine_visibility): Don't look for dllexport here.
1187 (determine_visibility_from_class): Tidy.
1189 2007-06-18 Simon Baldwin <simonb@google.com>
1192 * parser.c (cp_parser_single_declaration): Added check for storage
1193 class other than sc_none in parsed declaration, and a flag to indicate
1194 if the call is part of an explicit template specialization parse.
1195 * (cp_parser_explicit_specialization): Specialization check flag added
1196 to call to cp_parser_single_declaration(), set true.
1197 * (cp_parser_template_declaration_after_export): Specialization check
1198 flag added to call to cp_parser_single_declaration(), set false.
1199 * pt.c (check_explicit_specialization): Added code to copy visiblity
1200 and linkage from the templated function to the explicit specialization.
1202 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1204 * typeck.c (build_binary_op): For templates build the
1205 expression in pieces to avoid the assert in build2_stat.
1206 (get_member_function_from_ptrfunc):
1207 Change over to using POINTER_PLUS_EXPR and convert
1208 the second operand to sizetype.
1209 * typeck2.c (build_m_component_ref): Likewise.
1210 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1211 instead of PLUS_EXPR for pointers.
1212 (build_new_1): Likewise.
1213 (build_vec_delete_1): Likewise.
1214 (build_vec_delete): Likewise.
1215 * class.c (build_base_path): Likewise.
1216 (build_base_path): Likewise.
1217 (convert_to_base_statically): Likewise.
1218 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1219 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1220 instead of PLUS_EXPR.
1221 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1222 instead of PLUS_EXPR for pointers.
1223 * call.c (build_special_member_call): Likewise.
1224 * rtti.c (build_headof): Likewise.
1225 Use sizetype instead of ptrdiff_type_node.
1226 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1227 instead of PLUS_EXPR for pointers.
1228 * except.c (expand_start_catch_block): Do a
1229 NEGATIVE and then a POINTER_PLUS_EXPR instead
1231 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1232 PLUS_EXPR on pointer types over to use
1233 POINTER_PLUS_EXPR and remove the conversion
1234 to the pointer types.
1235 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1236 adding to a pointer type. Use size_int instead of
1237 ssize_int. Convert the index to sizetype before
1238 adding it to the pointer.
1240 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1242 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1243 (DECL_ANON_UNION_VAR_P): New macro.
1244 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1245 than DECL_VAR_MARKED_P, to keep track of which variables we have
1247 * decl.c (redeclaration_error_message): Complain about redeclaring
1248 anonymous union members at namespace scope.
1249 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1251 2007-06-14 Geoff Keating <geoffk@apple.com>
1253 * decl2.c (determine_visibility): Ensure that functions with
1254 hidden types as parameters are hidden.
1257 * decl2.c (determine_visibility): Remove duplicate code for
1260 2007-06-12 Ian Lance Taylor <iant@google.com>
1263 * init.c (avoid_placement_new_aliasing): New static function.
1264 (build_new_1): Call it.
1266 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1268 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1269 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1271 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1274 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1275 on init, the non-decl cond operand and increment value.
1277 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1280 * decl.c (check_initializer): Report an error when a brace enclosed
1281 initializer is used for a non-aggregate type in C++98.
1282 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1284 (grokdeclarator): Likewise.
1285 (move_fn_p): Likewise.
1286 * typeck.c (check_return_expr): Likewise.
1287 * call.c (reference_binding): Likewise.
1288 * error.c (cp_cpp_error): Likewise.
1289 * pt.c (check_default_tmpl_args): Likewise.
1291 * lex.c (init_reswords): Likewise.
1292 * parser.c (p_parser_primary_expression): Likewise.
1293 (TOKEN_PRECEDENCE): Likewise.
1294 (cp_parser_init_declarator): Likewise.
1295 (cp_parser_ptr_operator): Likewise.
1296 (cp_parser_parameter_declaration): Likewise.
1297 (cp_parser_enclosed_template_argument_list): Likewise.
1298 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1299 (cp_parser_next_token_ends_template_argument_p): Likewise.
1301 2007-06-04 Simon Baldwin <simonb@google.com>
1303 * decl.c (grokdeclarator): Readability change. Moved case labels
1304 into direct switch statement scope.
1306 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1308 * call.c (convert_like_real): Remove pointless code.
1310 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1312 * decl.c (get_atexit_fn_ptr_type): New function.
1313 (get_atexit_node): Use it.
1314 (start_cleanup_fn): Likewise.
1315 (register_dtor_fn): Use the object's destructor, instead of a
1316 separate cleanup function, where possible.
1317 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1318 (atexit_fn_ptr_type_node): New macro.
1319 * decl2.c (build_cleanup): Use build_address.
1321 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1323 * typeck.c (build_binary_op): Include types in error.
1325 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1328 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1329 needs runtime initialization.
1331 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1334 * semantics.c (finish_trait_expr): Complete the types.
1336 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1337 Douglas Gregor <doug.gregor@gmail.com>
1338 Pedro Lamarao <pedro.lamarao@mndfck.org>
1339 Howard Hinnant <howard.hinnant@gmail.com>
1343 * typeck.c (comptypes): Don't consider rvalue and lvalue
1344 reference types to be equivalent.
1345 (check_return_expr): Move from certain lvalues when returning
1347 * decl.c (grokdeclarator): Implement reference collapsing.
1348 (copy_fn_p): Don't consider constructors taking rvalue references
1349 to be copy constructors.
1351 * call.c (conversion): New "rvaluedness_matches_p" member.
1352 (convert_class_to_reference): Require reference type as first
1353 parameter instead of base type.
1354 (reference_binding): Add logic to handle rvalue references.
1355 (implicit_conversion): Update inaccurate comment.
1356 (convert_like_real): Disable creation of temporaries that are
1357 impossible to initialize for types with move constructors.
1358 (build_over_call): Elide move constructors when possible.
1359 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1360 (maybe_handle_ref_bind): Return conversion instead of type node.
1361 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1362 determine preferred conversion sequences.
1363 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1364 (LOOKUP_PREFER_RVALUE): New.
1365 (DECL_MOVE_CONSTRUCTOR_P): New.
1366 (struct cp_declarator): Add "reference" member for reference
1367 types, with new "rvalue_ref" flag.
1368 (cp_build_reference_type): Declare.
1369 (move_fn_p): Declare.
1370 * error.c (dump_type_prefix): Format rvalue reference types
1371 correctly in error messages.
1372 * except.c (build_throw): Move from certain lvalues when
1374 * mangle.c (write_type): Mangle rvalue references differently
1375 than regular references.
1376 * parser.c (make_reference_declarator): Add boolean parameter for
1378 (cp_parser_make_indirect_declarator): New.
1379 (cp_parser_new_declarator_opt): Call
1380 cp_parser_make_indirect_declarator.
1381 (cp_parser_conversion_declarator_opt): Ditto.
1382 (cp_parser_declarator): Ditto.
1383 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1385 * pt.c (tsubst): Implement reference collapsing.
1386 (maybe_adjust_types_for_deduction): Implement special template
1387 parameter deduction rule for rvalue references.
1388 (type_unification_real): Update calls to
1389 maybe_adjust_types_for_deduction.
1390 (try_one_overload): Ditto.
1391 (unify_pack_expansion): Ditto.
1392 * tree.c (lvalue_p_1): Handle rvalue reference types.
1393 (cp_build_reference_type): New.
1395 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1398 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1399 variables that need runtime initialization.
1401 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1404 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1405 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1406 case POSTDECREMENT_EXPR>): Return the error_mark_node
1407 if either the real or imaginary parts would an
1410 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1411 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1414 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1415 token is a closing brace, false if there are no tokens left.
1416 (cp_parser_namespace_alias_definition): Only consume the next token if
1417 it is a closing brace.
1419 * parser.c (cp_parser_class_specifier): Likewise.
1421 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1423 * semantics.c (finish_member_declaration): Fix a typo in the
1426 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1438 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1439 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1440 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1441 whether everything was okay. Fix indentation.
1442 (push_template_decl_real): Check for bare parameter packs in
1443 function parameters; where errors occur, mark the parameter types
1444 with ERROR_MARK_NODEs to avert ICEs.
1445 (coerce_template_parameter_pack): New.
1446 (coerce_template_parms): Moved parameter pack coercion into
1447 coerce_template_parameter_pack, and permit it anywhere in the
1448 template parameter list (not just at the end). Parameter and
1449 argument indices can vary (somewhat) separately now, so add
1450 PARM_IDX and ARG_IDX.
1451 (fn_type_unification): Don't set an argument pack as incomplete if
1452 no argument pack was deduced.
1453 (type_unification_real): If a type parameter is a parameter pack
1454 and has not otherwise been deduced, it will be deduced to an empty
1456 (more_specialized_fn): Use the actual lengths of the argument
1457 lists when comparing against expansions.
1458 * semantics.c (finish_member_declaration): If a field's type has
1459 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1461 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1464 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1466 2007-05-22 Ollie Wild <aaw@google.com>
1468 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1469 (unqualified_namespace_lookup): Adds check for hidden types.
1471 2007-05-22 Ollie Wild <aaw@google.com>
1473 * decl.c (duplicate_decls): Verify namespace names are unique.
1475 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1477 * decl.c (cxx_maybe_build_cleanup): Handle
1478 __attribute__((cleanup)).
1480 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1482 * cvt.c (cp_convert_and_check): Don't check warnings if the
1485 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1487 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1489 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1492 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1493 type only if is a class type (5.2.8/4).
1495 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1497 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1498 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1499 c_common_unsigned_type.
1501 2007-05-11 Silvius Rus <rus@google.com>
1503 * cp/typeck.c (build_indirect_ref): Add call to
1504 strict_aliasing_warning.
1505 (build_reinterpret_cast_1): Condition call to
1506 strict_aliasing_warning.
1508 2007-05-11 Jan Hubicka <jh@suse.cz>
1510 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1511 * decl2.c (start_objects): ctors and dtors are no longer public.
1512 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1514 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1516 * typeck.c (build_unary_op): Remove code that used to
1517 handle non lvalue increments/decrements.
1519 2007-05-07 Mike Stump <mrs@apple.com>
1521 * parser.c (check_empty_body): Add.
1522 (cp_parser_iteration_statement): Add call to check_empty_body.
1524 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1527 * mangle.c (write_mangled_name): Mangle static variable names.
1528 (write_unqualified_name): Use local-source-name for
1529 namespace-scope static variables.
1531 2007-05-04 Dirk Mueller <dmueller@suse.de>
1533 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1536 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1539 * decl2.c (constrain_class_visibility):
1540 Use strip_pointer_or_array_types instead of strip_array_types.
1542 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1545 * decl.c (reshape_init_r): Don't reshape the first element if it
1546 is a pointer to member function.
1548 2007-04-27 Simon Baldwin <simonb@google.com>
1550 * decl.c (grokparms): Changed message format from %qD to %qE.
1552 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1554 * error.c (maybe_warn_variadic_templates): Variadic templates are
1555 now in C++0x, so only warn about them in C++98 mode.
1557 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1560 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1561 integeral types from vectors types.
1563 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1566 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1567 for type dependent OMP_CLAUSE_DECLs.
1569 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1572 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1573 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1574 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1575 * init.c (build_zero_init): Adjust, as
1576 COMPLEX_TYPE is now a SCALAR_TYPE.
1577 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1578 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1580 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1582 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1583 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1584 (trait_expr_value): Adjust.
1586 2007-04-23 Simon Baldwin <simonb@google.com>
1588 * decl.c (grokparms): Added new error for duplicate function
1589 parameters names in function prototypes, to match gcc behavior.
1591 2007-04-23 Jan Hubicka <jh@suse.cz>
1593 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1596 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1598 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1599 instead of checking GIMPLE_STMT_P in chain_next.
1601 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1604 * call.c (convert_for_arg_passing): Convert bitfields to their
1607 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1610 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1612 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1615 * cp/decl2.c (constrain_class_visibility):
1616 Do not warn about the use of anonymous namespace in the main input file.
1618 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1620 * cp-tree.h (current_template_parms): Fix typo in comment.
1622 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1624 * cp-tree.h, error.c: Fix comment typos.
1626 2007-04-13 Jason Merrill <jason@redhat.com>
1629 * call.c (reference_binding): Add c_cast_p parm. If true,
1630 add quals to TO as needed to make it reference-compatible.
1632 2007-04-11 Jan Hubicka <jh@suse.cz>
1634 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1635 that we are not processing template_decl.
1637 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1640 * class.c (build_base_path): Ensure that the converted pointer has
1641 the same cv-qualification as the input.
1643 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1645 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1647 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1649 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1651 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1652 * tree.c (cp_add_pending_fn_decls): Remove.
1653 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1655 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1657 Revert change removing staticp.
1659 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1661 * cp-objcp-common.c (cxx_staticp): Remove.
1662 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1663 * cp-tree.h (cxx_staticp):
1665 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1667 * class.c (check_for_override): Don't remove dllmport attribute
1670 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1673 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1674 type issue error and return early.
1676 2007-03-30 Jason Merrill <jason@redhat.com>
1679 * typeck.c (cp_type_readonly): New fn.
1680 * cp-tree.h: Declare it.
1681 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1682 (cp_finish_decl): Not here.
1684 2007-03-31 Richard Guenther <rguenther@suse.de>
1686 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1689 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1694 * parser.c (declarator_can_be_parameter_pack): New.
1695 (cp_parser_template_parameter): Only parse the `...' if the
1696 declarator can be a parameter pack.
1697 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1699 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1700 types (they could be used as array bounds).
1701 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1702 (tsubst_pack_expansion): Handle failure to expand parameter
1705 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1708 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1709 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1710 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1711 (CLASS_TYPE_NON_UNION_P): Add.
1712 (struct lang_type_class): Add has_complex_dflt.
1713 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1714 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1715 * cp-tree.def: Add TRAIT_EXPR.
1716 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1717 * lex.c (struct resword): Add __has_nothrow_assign,
1718 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1719 __has_trivial_constructor, __has_trivial_copy,
1720 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1721 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1722 __is_pod, __is_polymorphic, __is_union.
1723 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1724 (cp_parser_trait_expr): New.
1725 * semantics.c (finish_trait_expr, trait_expr_value
1726 classtype_has_nothrow_copy_or_assign_p): New.
1727 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1729 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1730 * class.c (check_bases, check_field_decl, check_bases_and_members):
1731 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1732 * pt.c (uses_template_parms, tsubst_copy_and_build,
1733 value_dependent_expression_p, type_dependent_expression_p): Deal with
1735 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1737 2007-03-29 Richard Guenther <rguenther@suse.de>
1739 * tree.c (cp_walk_subtrees): Do not set input_location.
1741 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1744 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1747 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1749 * parser.c (struct cp_parser): Update comment for
1750 greater_than_is_operator_p.
1751 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1752 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1753 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1754 !GREATER_THAN_IS_OPERATOR_P.
1755 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1756 `>>' operators that will become two `>' tokens in C++0x.
1757 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1758 mode, allowing it to terminate default arguments.
1759 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1760 `>>' like two consecutive `>' tokens.
1761 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1762 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1763 ends a template argument.
1765 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1767 * decl.c (redeclaration_error_message): Complain when redeclaring
1768 a friend function with default template arguments (C++0x mode only).
1769 * cp-tree.h (check_default_tmpl_args): Declare.
1770 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1771 template arguments in function templates. Add support for checking
1772 the default template arguments of friend templates.
1773 (push_template_decl_real): Fix call to check_default_tmpl_args.
1774 (type_unification_real): If a template parameter has not been
1775 deduced but provides a default template argument, substitute into
1776 that default template argument.
1777 * parser.c (cp_parser_init_declarator): When declaring (but not
1778 defining!) a function template in C++0x mode, check for default
1781 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1784 * decl.c (grokdeclarator): Deal with cv-qualified function type
1785 typedefs in the same way for member and non-member functions.
1787 2007-03-26 Dirk Mueller <dmueller@suse.de>
1789 * parser.c (cp_parser_member_declaration): Pedwarn
1790 about stray semicolons after member declarations.
1792 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1795 * pt.c (instantiate_decl): Set in_system_header.
1797 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1799 * cp-tree.h (current_tempalte_parms): Improve documentation.
1800 * pt.c (current_template_args): Likewise.
1803 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1804 not consume tokens when failing.
1806 2007-03-22 Jim Wilson <wilson@specifix.com>
1807 Mark Mitchell <mark@codesourcery.com>
1810 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1811 consistent with FROM.
1813 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1815 * error.c (dump_expr): Handle dependent names that designate types.
1816 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1818 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1820 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1822 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1824 * cvt.c (cp_convert_and_check) : Define.
1825 * cp-tree.h (cp_convert_and_check): Declare.
1826 * call.c (convert_conversion_warnings): Rename to
1827 conversion_null_warnings. The warning for floating-point to
1828 integer is handled by convert_and_check in convert_like_real.
1829 (convert_like_real): convert_conversion_warnings was renamed as
1830 conversion_null_warnings.
1831 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1832 overflow and changes of value during conversion.
1834 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1837 * parser.c (cp_parser_statement): If 'namespace' is found, this
1838 only can be a namespace alias definition, so parse it now.
1839 (cp_parser_namespace_alias_definition): if we find an open brace
1840 instead of '=', then this is actually a misplaced namespace
1843 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1846 * decl.c (cxx_init_decl_processing): Move command-line options
1847 processing to c-opts.c.
1849 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1851 * ptree.c (cxx_print_type): Use formatting markup for integers
1852 when printing template parameter index/level/orig level.
1853 (cxx_print_xnode): Ditto.
1854 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1855 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1856 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1858 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1859 rather than a HOST_WIDE_INT.
1860 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1861 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1863 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1864 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1865 IN_BASE_INITIALIZER bool bitfields.
1866 (struct cp_declarator): Make KIND a 4-bit field. Make
1867 PARAMETER_PACK_P a bool bitfield just after KIND.
1868 * pt.c (uses_parameter_packs): Destroy the pointer set.
1869 (make_pack_expansion): Ditto.
1870 (check_for_bare_parameter_packs): Ditto.
1871 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1873 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1876 * call.c (convert_default_arg): Instead of copying the node,
1879 2007-03-15 Dirk Mueller <dmueller@suse.de>
1882 * call.c (convert_conversion_warnings): New..
1883 (convert_like_real): .. factored out from here.
1884 (convert_conversion_warnings): Add warning about
1885 false being converted to NULL in argument passing.
1887 2007-03-14 Dirk Mueller <dmueller@suse.de>
1889 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1890 (finish_do_body): Warn about empty body in do/while statement.
1892 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1894 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1896 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1899 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1902 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1904 * cp/repo.c (init_repo): Initialize random_seed saved options.
1905 (finish_repo): Adjust.
1907 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1910 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1913 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1915 * decl.c (compute_array_index_type): New warning flag warn_vla.
1917 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1920 * call.c (convert_default_arg): Copy non-constant arguments.
1922 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1925 * parser.c (cp_parser_postfix_expression): Disallow compound
1926 literals in constant expressions.
1929 * semantics.c (finish_typeof): Use unlowered_expr_type.
1931 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1934 * cp-tree.h (unlowered_expr_type): New function.
1935 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1936 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1937 (unlowered_expr_type): New function.
1938 (build_unary_op): Disallow predecrements of bool bitfields.
1939 * call.c (build_conditional_expr): Use unlowered_expr_type.
1940 * pt.c (type_unification_real): Likewise.
1942 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1945 * typeck.c (check_return_expr): Check for bare parameter packs.
1946 (comptypes): Compare template parameter packs and
1947 type pack expansions.
1948 * decl.c (grokdeclarator): Deal with the declaration of function
1950 (grokparms): Verify that the (optional) function parameter pack is
1951 at the end of the parameter list.
1952 (xref_basetypes): Handle pack expansions in the base class.
1953 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1954 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1955 (NONTYPE_ARGUMENT_PACK): New.
1956 (TYPE_PACK_EXPANSION): New.
1957 (EXPR_PACK_EXPANSION): New.
1958 (ARGUMENT_PACK_SELECT): New.
1959 * cp-objcp-common.c (cp_tree_size): Compute size of
1960 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1961 ARGUMENT_PACK_SELECT.
1962 * error.c (dump_template_argument): Print template argument packs.
1963 (dump_template_argument_list): Ditto.
1964 (dump_template_parameter): Dump `...' for template type parameter
1966 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1967 (dump_parameters): Print function parameter packs.
1968 (dump_template_parms): Print template argument packs.
1969 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1970 (maybe_warn_variadic_templates): New.
1971 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1972 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1973 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1975 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1976 (write_template_arg): Write argument packs as separate arguments.
1977 * cp-tree.h (struct template_parm_index_s): Add flag that
1978 indicates that the template parameter is actually a parameter
1980 (struct tree_argument_pack_select): New.
1981 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1982 (union lang_tree_node): Add argument_pack_select.
1983 (FUNCTION_PARAMETER_PACK_P): New.
1984 (PACK_EXPANSION_P): New.
1985 (PACK_EXPANSION_PATTERN): New.
1986 (SET_PACK_EXPANSION_PATTERN): New.
1987 (PACK_EXPANSION_PARAMETER_PACKS): New.
1988 (ARGUMENT_PACK_P): New.
1989 (ARGUMENT_PACK_ARGS): New.
1990 (SET_ARGUMENT_PACK_ARGS): New.
1991 (ARGUMENT_PACK_INCOMPLETE_P): New.
1992 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1993 (TEMPLATE_PARM_PARAMETER_PACK): New.
1994 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1995 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1996 (ARGUMENT_PACK_SELECT_INDEX): New.
1997 (ARGUMENT_PACK_SELECT_ARG): New.
1998 (struct cp_declarator): Add parameter_pack_p flag.
1999 (maybe_warn_variadic_templates): Declare.
2000 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2001 indicate a template parameter pack.
2002 (uses_parameter_packs): Declare.
2003 (template_parameter_pack_p): Declare.
2004 (template_parms_variadic_p): Declare.
2005 (make_pack_expansion): Declare.
2006 (check_for_bare_parameter_packs): Declare.
2007 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2008 sizeof... expressions.
2009 (pp_cxx_expression): Print pack expansions and non-type argument
2011 (pp_cxx_exception_specification): Print pack expansions.
2012 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2013 (pp_cxx_ctor_initializer): Print pack expansions.
2014 (pp_cxx_type_id): Print pack expansions.
2015 (pp_cxx_template_argument_list): Print argument packs.
2016 (pp_cxx_template_parameter): Print ellipsis for template parameter
2018 * pt.c (comp_template_parms): Compare template parameter packs.
2019 (template_parameter_pack_p): New.
2020 (template_parms_variadic_p): New.
2021 (template_args_variadic_p): New.
2022 (make_ith_pack_parameter_name): New.
2023 (struct find_parameter_pack_data): New.
2024 (find_parameter_packs_r): New.
2025 (uses_parameter_packs): New.
2026 (make_pack_expansion): New.
2027 (check_for_bare_parameter_packs): New.
2028 (expand_template_argument_pack): New.
2029 (reduce_template_parm_level): Propagate parameter pack flag.
2030 (process_template_parm): Add is_parameter_pack parameter to state
2031 when the parameter is actually a parameter pack. Create template
2032 parameter packs when is_parameter_pack is true.
2033 (current_template_args): The argument for a template parameter
2034 pack is an argument pack containing a single pack expansion.
2035 (process_partial_specialization): When checking that non-type
2036 argument expressions do not involve template parameters, loop over
2037 the arguments in argument packs separately.
2038 (push_template_decl_real): Check that the type of the declaration
2039 does not have any bare parameter packs. Check that primary
2040 templates have no more than one parameter pack, and that it comes
2041 at the end of the template parameter list.
2042 (convert_template_argument): Handle coercions for pack expansion
2043 expressions by coercing the pattern then rebuilding the expansion.
2044 (coerce_template_parms): When coercing the arguments for a
2045 variadic template, pack "extra" arguments into an argument pack.
2046 (coerce_template_template_parms): Cannot coerce between parameter
2047 packs and non-pack parameters.
2048 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2049 (comp_template_args): Expand all template arguments packs before
2050 comparing template argument lists.
2051 (mangle_class_name_for_template): Make argument packs as separate
2053 (for_each_template_parm_r): No need to handle BASELINK.
2054 (instantiate_class_template): Handle pack expansions in the base
2056 (tsubst_pack_expansion): New.
2057 (tsubst_template_args): Handle substitutions of argument packs and
2058 pack expansion into template argument lists.
2059 (tsubst_decl): Expand function parameter packs into separate
2060 function parameters.
2061 (tsubst_arg_types): Expand a type pack expansion into separate
2063 (tsubst_exception_specification): Handle pack expansions in
2064 exception specifiers.
2065 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2066 replacing a template parameter with its argument. If we encounter
2067 a substitution for an argument pack, just return the parameter
2069 (tsubst_copy): sizeof(X...) returns the number of elements in
2070 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2071 PARM_DECL is a parameter pack.
2072 (tsubst_expr): Expression pack expansions and argument packs
2073 cannot show up here; they will all be handled through function
2074 calls, sizeof, and template argument lists.
2075 (tsubst_copy_and_build): sizeof(X...) returns the number of
2076 elements in parameter pack X. Handle pack expansions in TREE_LIST
2077 and CONSTRUCTOR nodes.
2078 (fn_type_unification): Handle "incomplete" explicit template
2079 argument lists that specify some of the arguments for a template
2081 (type_unification_real): Unify arguments against pack expansions.
2082 (template_parm_level_and_index): New, helper function.
2083 (unify_pack_expansion): New.
2084 (unify): Unify argument packs on an argument-by-argument basis,
2085 handling variadic argument packs as well.
2086 (more_specialized_fn): Handle unification of function parameter
2087 packs. All things being equal, prefer non-variadic function
2088 templates to variadic function templates.
2089 (more_specialized_class): Prefer the variadic class template
2090 partial specialization that binds fewer arguments to a parameter
2092 (regenerate_decl_from_template): Expand function parameter packs
2093 into separate parameters.
2094 (instantiate_decl): Ditto.
2095 (tsubst_initializer_list): Handle pack expansions for base-class
2097 (dependent_type_p_r): Determine dependent types in argument packs
2098 and pack expansions.
2099 (value_dependent_expression_p): Determine value-dependence of
2100 non-type argument packs.
2101 (dependent_template_arg_p): Handle argument packs.
2102 * semantics.c (finish_cond): Check for bare parameter packs.
2103 (finish_expr_stmt): Ditto.
2104 (finish_for_expr): Ditto.
2105 (finish_switch_cond): Ditto.
2106 (finish_mem_initializers): Ditto.
2107 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2109 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2110 * parser.c (make_declarator): Declarator is not an expansion.
2111 (make_pointer_declarator): Transfer parameter pack flag to outer
2113 (make_reference_declarator): Ditto.
2114 (make_ptrmem_declarator): Ditto.
2115 (make_call_declarator): Ditto.
2116 (make_array_declarator): Ditto.
2117 (cp_parser_postfix_expression): Allow pack expansion expressions
2118 in the argument list for a call expression.
2119 (cp_parser_parenthesized_expression_list): Add new parameter
2120 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2121 into separate arguments."
2122 (cp_parser_new_placement): Allow pack expansion expressions.
2123 (cp_parser_new_initializer): Ditto.
2124 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2125 base-class initializer expansion.
2126 (cp_parser_mem_initializer): Ditto.
2127 (cp_parser_template_parameter_list): Keep track of whether the
2128 template parameter is a template parameter pack.
2129 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2130 template parameter pack.
2131 (cp_parser_type_parameter): Ditto.
2132 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2134 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2135 this declarator is a parameter pack.
2136 (cp_parser_parameter_declaration): The ellipsis does not end the
2137 parameter declaration, because it might be a parameter pack. Parse
2138 the ellipsis to indicate a parameter pack.
2139 (cp_parser_initializer): Allow pack expansions.
2140 (cp_parser_initializer_list): Allow ellipsis to create an
2141 initializer expansion.
2142 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2144 (cp_parser_type_id_list): Allow ellipsis to create an exception
2145 specifier expansion.
2146 (cp_parser_attribute_list): Don't allow pack expansions.
2147 (cp_parser_functional_cast): Allow pack expansions.
2148 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2149 compute the length of a parameter pack.
2150 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2151 end a template argument.
2152 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2153 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2156 2007-03-09 Dirk Mueller <dmueller@suse.de>
2158 * cp/call.c (build_new_op): Call warn_logical_operator.
2160 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2163 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2166 * pt.c (any_template_arguments_need_structural_equality_p):
2169 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2171 * decl.c (grokdeclarator): Disable warnings for anonymous
2174 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2176 * typeck2.c (readonly_error): Always emit a hard error.
2177 Remove last argument.
2178 * cp-tree.h (readonly_error): Adjust prototype.
2179 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2180 * typeck.c (build_unary_op): Likewise.
2181 (build_modify_expr): Likewise.
2183 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2186 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2188 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2191 * parser.c (struct cp_parser): New IN_IF_STMT.
2192 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2193 returning if parsing the body of an 'if' statement or issuing an
2194 error and continuing.
2195 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2197 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2199 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2202 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2205 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2207 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2208 Objective-C++. Don't exit early if -shared-libgcc needs to be
2211 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2213 * typeck.c (common_base_type): Delete unused function.
2215 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2217 * Make-lang.in: Add dummy lang.install-pdf target.
2219 2007-03-01 Simon Baldwin <simonb@google.com>
2222 * decl.c (check_tag_decl): Added new warning for typedef ignored
2223 when it precedes an otherwise valid non-typedef declaration.
2225 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2227 * typeck.c (build_function_call): Store converted arguments
2228 in a stack-allocated array instead of building a list.
2229 (convert_arguments): Store arguments in the array passed in as an
2230 argument, and return the actual number of arguments.
2231 * call.c (build_call): Delete, and replace with...
2232 (build_call_n, build_call_a): New.
2233 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2234 (build_over_call): Store converted arguments in a stack-allocated
2235 array instead of building a list.
2236 (build_cxx_call): Pass arguments in an array instead of as a list.
2237 (build_java_interface_fn_ref): Rewrite to avoid constructing
2239 * tree.h: Update declarations to reflect above changes.
2240 * method.c (use_thunk): Use a stack-allocated array to hold
2241 the arguments instead of a list.
2242 * rtti.c (throw_bad_cast): Update call to cxx_call.
2243 (throw_bad_typeid): Likewise.
2244 (build_dynamic_cast_1): Likewise.
2245 * init.c (build_builtin_delete_call): Use build_call_n.
2246 * decl.c (expand_static_init): Likewise.
2247 * except.c (cp_protect_cleanup_actions): Likewise.
2248 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2249 (gimplify_must_not_throw_expr): Likewise.
2250 (cxx_omp_apply_fn): Use build_call_a.
2252 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2254 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2255 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2257 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2259 * cp-tree.h (static_ctors): Remove.
2260 * cp-tree.h (static_dtors): Likewise.
2261 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2262 refactoring of tree_map hierarchy.
2263 (decl_shadowed_for_var_insert): Likewise.
2264 * semantics.c (expand_body): Use c_expand_body.
2265 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2266 * decl2.c (static_ctors): Remove.
2267 (static_dtors): Likewise.
2268 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2269 objc_generate_static_init_call. Do not call static_[cd]tors.
2270 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2272 (cp_write_global_declarations): Likewise.
2274 2007-02-23 Richard Guenther <rguenther@suse.de>
2276 * class.c (note_name_declared_in_class): Make declaration
2277 changes meaning a pedwarn.
2279 2007-02-22 Michael Matz <matz@suse.de>
2282 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2283 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2284 dump_function_decl): Guard emitting outer scopes by new flag.
2285 * cp-lang.c (cxx_dwarf_name): New function.
2286 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2287 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2289 (push_template_decl_real, lookup_template_class): Remove calls
2292 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2294 * call.c (build_new_method_call): Ensure that explicit calls of
2295 destructors have type "void".
2297 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2299 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2300 and -Walways-true with -Waddress.
2301 * cvt.c (convert_to_void): Replace unconditional warning with
2304 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2306 * decl.c, tree.c: Fix comment typos.
2308 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2311 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2312 statement expression if we had an error mark node.
2314 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2315 Brooks Moses <brooks.moses@codesourcery.com>
2316 Lee Millward <lee.millward@codesourcery.com>
2318 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2319 Change class to tcc_vl_exp.
2321 * call.c (build_call): Use build_call_list instead
2323 (build_over_call): Likewise.
2324 (build_new_method_call): Use build_min_non_dep_call_list
2325 instead of build_min_non_dep.
2327 * error.c (dump_call_expr_args): New function.
2328 (dump_aggr_init_expr_args): New function.
2329 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2330 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2332 * cvt.c (convert_to_void): Use build_call_array instead
2333 of build3; use new AGGR_INIT_EXPR accessor macros.
2335 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2336 instead of TREE_CODE_LENGTH.
2338 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2339 AGGR_INIT_EXPR accessor macros.
2341 * cp-gimplify.c (cp_gimplify_init_expr): Use
2342 AGGR_INIT_EXPR_SLOT to set the slot operand.
2344 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2345 (AGGR_INIT_EXPR_SLOT): New macro.
2346 (AGGR_INIT_EXPR_ARG): New macro.
2347 (aggr_init_expr_nargs): New macro.
2348 (AGGR_INIT_EXPR_ARGP): New macro.
2349 (aggr_init_expr_arg_iterator): New.
2350 (init_aggr_init_expr_arg_iterator): New.
2351 (next_aggr_init_expr_arg): New.
2352 (first_aggr_init_expr_arg): New.
2353 (more_aggr_init_expr_args_p): New.
2354 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2355 (stabilize_aggr_init): New declaration.
2356 (build_min_non_dep_call_list): Likewise.
2358 * tree.c (process_aggr_init_operands): New function.
2359 (build_aggr_init_array) New function.
2360 (build_cplus_new): Update to use new CALL_EXPR and
2361 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2362 build_aggr_init_array.
2363 (build_min_non_dep_call_list) New function.
2364 (build_min_nt): Assert input code parameter is not a variable
2365 length expression class.
2366 (build_min, build_min_non_dep): Likewise.
2367 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2368 to check for equality instead of recursing. Handle tcc_vl_exp
2370 (stabilize_call): Update to only handle CALL_EXPRs, not
2371 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2372 (stabilize_aggr_init): New function.
2373 (stabilize_init): Use it.
2375 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2376 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2377 AGGR_INIT_EXPR accessor macros and argument iterators.
2379 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2380 build_vl_exp. Iterate through the operands, recursively
2381 processing each one.
2382 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2383 CALL_EXPR accessor macros.
2384 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2385 tree code classes. Use TREE_OPERAND_LENGTH instead of
2388 * semantics.c (finish_call_expr): Use build_nt_call_list
2389 instead of build_nt.
2390 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2391 accessor macros. Use build_call_array to construct the
2392 CALL_EXPR node instead of build3
2394 * decl2.c (build_offset_ref_call_from_tree): Use
2395 build_nt_call_list and build_min_non_dep_call_list instead
2396 of build_min_nt and build_min_non_dep.
2398 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2399 Use build_nt_call_list instead of build_min_nt.
2401 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2404 * call.c (build_conditional_expr): Improve error message.
2406 2007-02-13 Dirk Mueller <dmueller@suse.de>
2408 * friend.c (do_friend): Annotate warning about friend
2409 declarations in templates with OPT_Wnon_template_friend.
2410 Convert informal message from warning() to inform().
2412 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2413 Mark Mitchell <mark@codesourcery.com>
2416 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2417 instantiations for variables.
2419 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2422 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2423 Check warn_unused_value just once.
2425 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2428 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2429 (fn_type_unificiation): Likewise.
2430 (get_bindings): Likewise.
2432 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2435 * decl.c (finish_function): Use DECL_REPLACEABLE.
2436 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2438 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2440 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2442 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2444 * decl.c (grokvardecl): Don't error if !have_tls.
2445 (grokdeclarator): Likewise.
2446 * parser.c (cp_parser_omp_threadprivate): Likewise.
2448 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2451 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2452 parameters and result decls in omp clauses.
2453 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2456 2007-02-05 Dirk Mueller <dmueller@suse.de>
2459 * parser.c (cp_parser_class_specifier): Always initialize bases.
2461 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2463 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2464 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2465 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2467 * semantics.c (finish_omp_atomic): Store a whole expression node
2468 in operand 1, and integer_zero_node in operand 0, for dependent
2469 OMP_ATOMIC. Rewrite to make flow easier to understand.
2471 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2473 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2475 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2477 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2478 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2480 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2482 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2483 keyword warning to -Wc++0x-compat.
2485 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2487 * decl.c (grokdeclarator): Update documentation.
2489 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2492 * decl.c (grokdeclarator): If __thread is used together with
2493 a storage class other than extern and static, clear thread_p
2494 after issuing diagnostics and fall through to checking the
2497 2007-01-30 Roger Sayle <roger@eyesopen.com>
2499 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2500 calculating the size of an array (to avoid recursive errors).
2502 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2505 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2507 * call.c (convert_like_real): Don't warn when converting to
2510 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2512 * decl.c (pop_label): Replace warning with call to
2513 warn_for_unused_label.
2515 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2518 * semantics.c (finish_pseudo_destructor_expr): Check the
2519 destrutor name by calling check_dtor_name.
2521 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2523 * lex.c (D_CPP0X): Rename.
2525 (reswords): D_CPP0X -> D_CXX0X.
2526 (init_reswords): Ditto.
2527 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2528 of C++0x keywords as identifiers.
2530 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2533 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2536 2007-01-23 Ian Lance Taylor <iant@google.com>
2538 * typeck.c (convert_for_assignment): Only warn about a = b = c
2539 when converting to bool.
2541 2007-01-23 Roger Sayle <roger@eyesopen.com>
2543 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2545 * typeck.c (ignore_overflows): Remove the remaining uses of
2546 TREE_CONSTANT_OVERFLOW.
2548 2007-01-20 Jan Hubicka <jh@suse.cz>
2550 * decl2.c (start_objects, start_static_storage_duration_function):
2551 Do not make the functions uninlinable.
2553 2007-01-17 Ian Lance Taylor <iant@google.com>
2555 * class.c (add_method): Call VEC_reserve_exact rather than passing
2556 a negative size to VEC_reserve.
2558 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2561 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2563 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2566 * decl.c (make_typename_type): If the qualified name is not a
2567 type, issue an error.
2568 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2571 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2573 * rtti.c: Include target.h.
2574 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2575 don't emit typeinfo for fundamental types as weak.
2576 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2578 2007-01-08 Richard Guenther <rguenther@suse.de>
2580 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2582 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2584 * call.c (standard_conversion): Pass flag to
2585 vector_types_convertible_p to disallow emission of note.
2586 * typeck.c (convert_for_assignment): Pass flag to
2587 vector_types_convertible_p to allow emission of note.
2588 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2589 to disallow emission of note.
2591 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2594 * typeck.c (build_binary_op): Call overflow_warning if
2595 TREE_OVERFLOW_P is true for the result and not for any of the
2598 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2601 * class.c (add_method): Don't wait until template
2602 instantiation time to complain about duplicate methods.
2604 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2607 * semantics.c (finish_unary_op_expr): Warn only if result
2608 overflowed and operands did not.
2610 2007-01-05 Ian Lance Taylor <iant@google.com>
2612 * typeck.c (build_binary_op): Warn about comparing a non-weak
2615 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2617 * pt.c (tsubst): Propagate the need for structural equality checks
2618 when reducing the level of template parameters.
2620 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2622 * pt.c: Fix a comment typo.
2624 2007-01-02 Ian Lance Taylor <iant@google.com>
2626 * semantics.c (maybe_convert_cond): Optionally warn when using an
2627 assignment as a condition.
2628 * typeck.c (convert_for_assignment): Optionally warn about
2629 assigning the result of an assignment to a bool.
2631 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2633 * pt.c (canonical_template_parms): Correct typo in comment.
2635 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2637 * typeck.c (structural_comptypes): Renamed from "comptypes".
2638 (comptypes): Use canonical type information to perform fast type
2639 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2640 canonical type comparison returns the same results as we would see
2641 from the current, structural check. Support COMPARE_STRUCTURAL
2642 when we need structural checks.
2643 * decl.c (typename_compare): Fix comment.
2644 (build_typename_type): TYPENAME_TYPE nodes require structural
2645 equality checks, because they resolve different based on the
2647 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2648 require structural equality checks (for now).
2649 (build_ptrmemfunc_type): Build the canonical pointer to member
2651 (compute_array_index_type): Whenever we build a new index type
2652 to represent the size of an array in a template, we need to mark
2653 this index type as requiring structural equality. This goes for
2654 arrays with value-dependent sizes with the current ABI, or all
2656 * tree.c (cplus_array_hash): New.
2657 (struct cplus_array_info): New.
2658 (cplus_array_compare): New.
2659 (cplus_array_htab): New.
2660 (build_cplus_array_type_1): Use a hash table to cache the array
2661 types we build. Build the canonical array type for each array
2663 (cp_build_qualified_type_real): When building a cv-qualified array
2664 type, use the hash table of array types and build canonical array
2666 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2667 use structural equality (for now).
2668 * cp-tree.h (COMPARE_STRUCTURAL): New.
2669 * pt.c (canonical_template_parms): New.
2670 (canonical_type_parameter): New.
2671 (process_template_parm): Find the canonical type parameter.
2672 (lookup_template_class): When we have named the primary template
2673 type, set the canonical type for our template class to the primary
2674 template type. If any of the template arguments need structural
2675 equality checks, the template class needs structural equality
2677 (tsubst): When reducing the level of a template template
2678 parameter, we require structural equality tests for the resulting
2679 parameter because its template parameters have not had their types
2680 canonicalized. When reducing a template type parameter, find the
2681 canonical reduced type parameter.
2682 (any_template_arguments_need_structural_equality_p): New.