1 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
4 * call.c (build_user_type_conversion_1): Do not consider conversion
5 functions to convert a (possibly cv-qualified) object to the (possibly
6 cv-qualified) same object type (or a reference to it), to a (possibly
7 cv-qualified) base class of that type (or a reference to it).
9 2007-10-12 Paolo Carlini <pcarlini@suse.de>
11 * pt.c (tsubst): Use template_parm_level_and_index.
13 2007-10-12 Jakub Jelinek <jakub@redhat.com>
16 * parser.c (cp_parser_compound_statement): Handle label-declarations
17 at the beginning of the compound statement.
18 (cp_parser_block_declaration): Issue diagnostics about __label__
19 not at the beginning of a block.
21 2007-10-11 Paolo Carlini <pcarlini@suse.de>
24 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
25 to convert_template_argument.
26 (coerce_template_parms): Return error_mark_node after fixed-length
28 (tsubst_decl): Check for error_mark_node the return value of the
29 first tsubst in 'case VAR_DECL'.
31 2007-10-08 Ollie Wild <aaw@google.com>
33 * typeck2.c (digest_init): Call cplus_expand_constant after
34 convert_for_initialization.
35 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
36 * expr.c (cplus_expand_constant): Updated function description.
38 2007-10-04 Jason Merrill <jason@redhat.com>
41 * call.c (initialize_reference): Handle local static reference
44 2007-10-03 Jason Merrill <jason@redhat.com>
47 * name-lookup.c (push_namespace_with_attrs): Fold back into...
48 (push_namespace): Here.
49 (handle_namespace_attrs): New fn for the attr code.
50 (leave_scope): Don't pop_visibility.
51 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
52 * parser.c (cp_parser_namespace_definition): Call
53 handle_namespace_attrs and pop_visibility as appropriate.
56 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
58 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
60 * decl.c (duplicate_decls): Preserve linkage flags for mere
61 redeclarations of gnu_inline definitions.
63 2007-10-03 Jason Merrill <jason@redhat.com>
66 * decl.c (wrap_cleanups_r): New fn.
67 (wrap_temporary_cleanups): New fn.
68 (initialize_local_var): Call it.
70 2007-09-29 Jason Merrill <jason@redhat.com>
73 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
74 constant to not have DECL_EXTERNAL if it's file-local.
76 2007-09-28 Ollie Wild <aaw@google.com>
79 2007-09-27 Ollie Wild <aaw@google.com>
81 * typeck2.c (digest_init): Call cplus_expand_constant after
82 convert_for_initialization.
83 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
84 * expr.c (cplus_expand_constant): Updated function description.
86 2007-09-28 Jason Merrill <jason@redhat.com>
89 * class.c (layout_empty_base): Take rli parameter, update
90 rli->record_align if empty base has user-specified alignment.
91 (build_base_field): Pass rli to it.
93 2007-09-28 Paolo Carlini <pcarlini@suse.de>
96 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
98 2007-09-28 Paolo Carlini <pcarlini@suse.de>
101 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
102 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
103 (dump_parameters): Just call dump_type for argument packs too.
105 2007-09-28 Jakub Jelinek <jakub@redhat.com>
108 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
109 qualification by creating qualified PACK_EXPANSION_PATTERN and
110 then calling make_pack_expansion on it.
112 2007-09-27 Ollie Wild <aaw@google.com>
114 * typeck2.c (digest_init): Call cplus_expand_constant after
115 convert_for_initialization.
116 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
117 * expr.c (cplus_expand_constant): Updated function description.
119 2007-09-27 Jason Merrill <jason@redhat.com>
122 * decl2.c (is_late_template_attribute): Don't crash on unknown
125 2007-09-27 Paolo Carlini <pcarlini@suse.de>
128 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
129 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
130 spaces in the formatting.
131 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
133 2007-09-27 Jakub Jelinek <jakub@redhat.com>
135 * error.c (cxx_print_error_function): Add third argument, pass
136 it over to lhd_print_error_function.
137 (cp_print_error_function): If diagnostic->abstract_origin, print
139 * cp-tree.h (struct diagnostic_info): New forward decl.
140 (cxx_print_error_function): Add third argument.
142 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
145 * name-lookup.c (pushtag): Do not create an implicit typedef before
146 the associated type declaration is known to be valid.
148 2007-09-25 Jakub Jelinek <jakub@redhat.com>
150 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
151 rather than pointers.
153 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
156 * search.c (check_final_overrider): Fail if
157 targetm.comp_type_attributes returns 0.
159 2007-09-24 Jason Merrill <jason@redhat.com>
162 * pt.c (resolve_typename_type): Don't look things up in the original
163 template if it would mean losing template arguments.
165 2007-09-24 Jakub Jelinek <jakub@redhat.com>
168 * cp-tree.h (cxx_type_hash_eq): New prototype.
169 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
170 * tree.c (cxx_type_hash_eq): New function.
172 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
175 * tree.c (cp_build_qualified_type_real): Build a canonical
176 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
178 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
182 * tree.c (cplus_array_compare): Compare pointers, not types.
183 (build_cplus_array_type_1): Store new array type into the hash
184 table before building the canonical type; build the canonical type
186 (cp_build_qualified_type_real): Put all of the array types with
187 cv-qualified element types into the C++ array hash table, built as
188 variants of the unqualified versions.
190 2007-09-23 Jason Merrill <jason@redhat.com>
193 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
194 for deprecation warnings.
196 2007-09-22 Jason Merrill <jason@redhat.com>
199 * call.c (build_over_call): Warn about deprecated virtuals.
202 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
203 (MAYBE_TAGGED_TYPE_P): Remove.
204 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
205 instead of calling is_late_template_attribute again.
206 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
207 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
208 Don't crash on typedefs from non-template classes.
209 * decl2.c (grokfield): Don't sorry about attrs on template parms.
210 (is_late_template_attribute): All attributes applied to template
211 parms or typename types are dependent. Static.
212 (splice_template_attributes): Pass decl through.
213 (save_template_attributes): Likewise.
215 2007-09-20 Jakub Jelinek <jakub@redhat.com>
218 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
219 returned from tsubst_pack_expansion.
220 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
221 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
223 2007-09-20 Paolo Carlini <pcarlini@suse.de>
226 * semantics.c (finish_id_expression): Use consistently
227 context_for_name_lookup.
228 * decl.c (fixup_anonymous_aggr): Fix error message for
229 anonymous struct (vs union).
231 2007-09-19 Jason Merrill <jason@redhat.com>
234 * pt.c (tsubst): Handle typedefs by looking for the specialization.
235 (retrieve_specialization): Only tagged types use
236 DECL_TEMPLATE_INSTANTIATIONS.
237 (instantiate_class_template): Push nested classes too.
238 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
240 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
241 * init.c (is_aggr_type): Remove redundant tests.
242 * class.c (push_nested_class): Use CLASS_TYPE_P.
244 2007-09-20 Paolo Carlini <pcarlini@suse.de>
247 * init.c (build_zero_init): If, recursively, build_zero_init
248 returns a NULL_TREE, do not append it to the VEC of constructors.
250 2007-09-18 Jason Merrill <jason@redhat.com>
253 * pt.c (apply_late_template_attributes): Set processing_template_decl.
254 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
255 ATTR_FLAG_TYPE_IN_PLACE.
256 (tsubst): Do unqualified lookup to find typedefs from current class.
257 [ARRAY_TYPE]: Propagate alignment info.
258 * decl2.c (is_late_template_attribute): Only defer handling of
259 attribute aligned if the expression is dependent.
260 (save_template_attributes): If we're deferring any attributes,
261 make this a naming typedef.
263 2007-09-18 Paolo Carlini <pcarlini@suse.de>
266 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
267 va_arg instead of __builtin_va_arg.
269 2007-09-18 Paolo Carlini <pcarlini@suse.de>
272 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
273 (pp_cxx_primary_expression): Use it.
274 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
275 * error.c (dump_expr): Use it.
277 2007-09-18 Paolo Carlini <pcarlini@suse.de>
280 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
281 out case TYPEID_EXPR to...
282 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
283 and pp_cxx_right_paren.
284 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
285 * error.c (dump_expr): Use it.
287 2007-09-18 Paolo Carlini <pcarlini@suse.de>
290 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
291 (pp_cxx_primary_expression): Use it.
292 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
293 * error.c (dump_expr): Use it.
295 2007-09-16 Paolo Carlini <pcarlini@suse.de>
298 * init.c (build_new): Remove warning for zero-element
301 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
304 * call.c (maybe_handle_implicit_object): Set this_p, clear
305 rvaluedness_matches_p.
306 (compare_ics): Do not compare rvaluedness matching when one of the
307 operands is an implicit object.
309 2007-09-14 Jason Merrill <jason@redhat.com>
311 PR c++/17743, c++/19163
312 * decl2.c (is_late_template_attribute): New fn.
313 (splice_template_attributes, save_template_attributes): New fns.
314 (cplus_decl_attributes): Call save_template_attributes.
315 * pt.c (apply_late_template_attributes): New fn.
316 (instantiate_class_template, tsubst_decl): Use it.
317 * cp-tree.h: Declare is_late_template_attribute.
319 2007-09-13 Tom Tromey <tromey@redhat.com>
321 * parser.c (cp_lexer_new_main): Don't use
322 c_lex_return_raw_strings.
323 (cp_lexer_get_preprocessor_token): Update. Add special case when
326 2007-09-11 Jan Hubicka <jh@suse.cz>
328 * method.c (use_thunk): Use tree_rest_of_compilation
329 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
330 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
331 * cp-tree.h (expand_body): Kill.
332 (emit_associated_thunks): Declare.
333 * semantics.c (emit_associated_thunks): Export.
336 2007-09-09 David Daney <ddaney@avtrex.com>
339 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
340 to calculate cookie_ptr.
342 2007-09-08 Jason Merrill <jason@redhat.com>
345 * pt.c (most_specialized_class): Set processing_template_decl
346 while tsubsting partial spec args.
348 2007-09-06 Jason Merrill <jason@redhat.com>
350 * decl2.c (get_guard): Copy visibility from the guarded variable.
352 2007-09-06 Jan Hubicka <jh@suse.cz>
354 * semantics.c (expand_body): Do not mark arguments of clones used.
356 2007-09-06 Paolo Carlini <pcarlini@suse.de>
359 * decl.c (cp_finish_decl): When processing_template_decl,
360 deal correctly with init as TREE_LIST.
362 2007-09-06 Tom Tromey <tromey@redhat.com>
364 * decl.c (finish_function): Put return's location on line zero of
367 2007-09-05 Jason Merrill <jason@redhat.com>
370 * except.c (prepare_eh_type): Use type_decays_to.
373 * init.c (build_delete): Use build_headof to get the address of the
374 complete object if we aren't using the deleting destructor.
375 * rtti.c (build_headof): No longer static.
376 * cp-tree.h: Declare it.
378 2007-09-06 Jakub Jelinek <jakub@redhat.com>
380 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
381 decl if a prototype for XX is provided with throw().
384 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
385 on __*_chk non-__builtin_* decls.
387 2007-09-05 Paolo Carlini <pcarlini@suse.de>
390 * semantics.c (finish_id_expression): Use context_for_name_lookup
391 insted of DECL_CONTEXT, to see through anonymous structs and unions.
392 * class.c (finish_struct_anon): Deal correctly with anonymous
393 structs (vs unions, as GNU extension) in error messages.
395 2007-09-05 Jan Hubicka <jh@suse.cz>
397 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
398 call, DECL_EXTERNAL checks and current_function_decl saving.
400 2007-09-05 Paolo Carlini <pcarlini@suse.de>
403 * parser.c (cp_parser_primary_expression): Return error_mark_node
404 when a statement-expression is found in a template-argument list.
406 2007-09-04 Jason Merrill <jason@redhat.com>
408 * except.c (initialize_handler_parm): Use
409 fold_build_cleanup_point_expr.
412 * call.c (reference_binding): Don't look for user-defined conversions
416 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
417 the MUST_NOT_THROW_EXPR.
419 2007-09-04 Richard Sandiford <richard@codesourcery.com>
421 * decl.c (cp_finish_decl): Call determine_visibility before
422 make_rtl_for_nonlocal_decl.
424 2007-09-04 Jason Merrill <jason@redhat.com>
427 * pt.c (most_specialized_class): Substitute outer template
428 arguments into the arguments of a member template partial
430 (strip_innermost_template_args): New fn.
432 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
434 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
436 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
438 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
439 * decl.c (cp_make_fname_decl): Likewise,
440 * parser.c (cp_parser_string_literal): Likewise,
441 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
442 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
445 2007-09-02 Paolo Carlini <pcarlini@suse.de>
448 * typeck.c (build_unary_op): Fix error message for
449 Boolean expression as operand to operator--.
451 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
453 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
454 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
457 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
460 * init.c (build_default_init): Make extern.
461 * cp-tree.h (build_default_init): Declare here.
462 * pt.c (tsubst_expr): When the instantiation of the initializer of
463 a variable results in an empty list, default-initialize the
465 (tsubst_copy_and_build): When the instantiation of the initializer
466 in a new expression results in an empty initializer list,
467 default-initialize it.
469 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
471 * mangle.c (write_type): Change mangling of rvalue reference from
474 2007-08-31 Jakub Jelinek <jakub@redhat.com>
476 * decl.c (duplicate_decls): Remove duplicated line.
478 2007-08-31 Paolo Carlini <pcarlini@suse.de>
481 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
482 BOUND_TEMPLATE_TEMPLATE_PARM.
484 2007-08-31 Paolo Carlini <pcarlini@suse.de>
487 * search.c (lookup_member): Check the name argument for
490 2007-08-31 Paolo Carlini <pcarlini@suse.de>
493 * parser.c (cp_parser_trait_expr): Check rerurn value of
496 2007-08-30 Ollie Wild <aaw@google.com>
498 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
499 convert_ptrmem for pointer to member conversions.
500 (convert_to_pointer_force): Update cp_convert_to_pointer call.
501 (ocp_convert): Update cp_convert_to_pointer call.
502 * typeck.c (convert_ptrmem): Add conditional for null pointers to
504 (build_static_cast_1): Check can_convert for conversions in either
506 (get_delta_difference_1): New function.
507 (get_delta_difference): Refactor to call get_delta_difference_1.
509 2007-08-30 Jakub Jelinek <jakub@redhat.com>
511 * decl.c (start_preparsed_function): Set
512 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
514 2007-08-28 Paolo Carlini <pcarlini@suse.de>
517 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
518 BOUND_TEMPLATE_TEMPLATE_PARM.
520 2007-08-28 Jakub Jelinek <jakub@redhat.com>
524 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
525 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
527 2007-08-27 Jason Merrill <jason@redhat.com>
530 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
531 Look inside STMT_EXPR.
532 * semantics.c (stmt_expr_value_expr): New fn.
533 * cp-tree.h: Declare it.
536 * decl.c (groktypename): Ignore attributes applied to class type.
538 2007-08-28 Richard Guenther <rguenther@suse.de>
540 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
542 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
544 * error.c (dump_expr): Handle COMPLEX_CST.
545 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
546 (pp_cxx_expression): Likewise.
548 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
550 * decl.c (GNU_INLINE_P): New.
551 (duplicate_decls): Handle gnu_inline. Merge attributes and
552 some flags in overriding definitions.
553 (redeclaration_error_message): Handle gnu_inline.
554 (start_preparsed_function): Likewise.
556 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
558 * call.c (sufficient_parms_p): Constify.
559 * class.c (same_signature_p): Likewise.
560 * cp-gimplify.c (is_invisiref_parm,
561 cxx_omp_privatize_by_reference): Likewise.
562 * cp-objcp-common.c (has_c_linkage): Likewise.
563 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
564 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
565 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
566 num_artificial_parms_for, comp_template_parms,
567 template_parameter_pack_p, any_dependent_template_arguments_p,
568 any_type_dependent_arguments_p, any_value_dependent_elements_p,
569 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
570 zero_init_p, member_p, cp_lvalue_kind,
571 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
572 varargs_function_p, is_dummy_object, special_function_kind,
573 string_conv_p, type_unknown_p, comp_except_specs, compparms,
574 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
575 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
576 cp_has_mutable_p, at_least_as_qualified_p,
577 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
578 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
579 * except.c (nothrow_libfn_p): Likewise.
580 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
582 * pt.c (comp_template_parms, template_parameter_pack_p,
583 any_type_dependent_arguments_p, any_value_dependent_elements_p,
584 any_dependent_template_arguments_p): Likewise.
585 * repo.c (repo_export_class_p): Likewise.
586 * semantics.c (anon_aggr_type_p): Likewise.
587 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
588 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
589 varargs_function_p, member_p, is_dummy_object, pod_type_p,
590 zero_init_p, special_function_p): Likewise.
591 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
592 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
593 compparms, invalid_nonstatic_memfn_p,
594 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
595 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
596 cp_has_mutable_p, lvalue_or_else): Likewise.
598 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
600 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
601 * cp-objcp-common.c (cp_tree_size): Ditto.
602 * tree.c (cp_walk_subtrees): Ditto
603 * cp-tree.def (TINST_LEVEL): Go away.
604 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
605 move together with other non-tree structs.
606 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
607 (union lang_tree_node): Eliminate tinst_level field.
608 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
609 (current_instantiation, outermost_tinst_level): Return
610 a "struct tinst_level *".
612 * error.c (print_instantiation_partial_context): Change second
613 parameter to a "struct tinst_level *". Replace accessor macros
615 (print_instantiation_full_context): Likewise.
616 * lex.c (in_main_input_context): Likewise.
618 * pt.c (struct pending_templates): New.
619 (pending_templates, last_pending_template): Use it as a type.
620 (current_tinst_level): Change typo to "struct tinst_level *"
621 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
622 (add_pending_template): Construct a "struct pending_template".
623 Replace TINST_LEVEL accessor macros with field access.
624 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
625 (pop_tinst_level): Likewise.
626 (instantiate_pending_templates): Likewise. Factor common code used
627 when an instantiation has been done.
628 (outermost_tinst_level): Replace tree_last with loop.
629 (current_instantiation): Return a "struct tinst_level *".
631 2007-08-24 Ollie Wild <aaw@google.com>
633 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
634 * name-lookup.h (cp_binding_level): Remove vtables member.
636 2007-08-24 Richard Guenther <rguenther@suse.de>
638 * tree.c (cp_cannot_inline_tree_fn): Remove.
639 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
640 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
643 2007-08-24 Jakub Jelinek <jakub@redhat.com>
646 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
647 error_mark_node right away if build_expr_type_conversion
651 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
652 is error_mark_node rather than NULL_TREE.
653 * pt.c (check_explicit_specialization): Likewise.
656 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
657 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
659 2007-08-22 Jason Merrill <jason@redhat.com>
662 * pt.c (outermost_tinst_level): New function.
663 * lex.c (in_main_input_context): New function.
664 * cp-tree.h: Declare it.
665 * decl2.c (constrain_class_visibility): Use it to avoid warning
666 about uses of the anonymous namespace in the main input file.
668 2007-08-21 Jakub Jelinek <jakub@redhat.com>
670 * init.c (build_new_1): Use get_target_expr instead of save_expr.
672 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
675 * class.c (finish_struct_1): Warn when a class has virtual
676 functions and accessible non-virtual destructor.
678 2007-08-20 Richard Guenther <rguenther@suse.de>
682 * call.c (build_new_method_call): Convert initializer to
684 * init.c (build_aggr_init): Do not fiddle with types.
685 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
686 * except.c (build_throw): Do not drop qualifiers for the
688 * typeck.c (get_member_function_from_ptrfunc): Do not
689 fiddle with types, instead convert.
690 (build_ptrmemfunc1): Convert to the target type for
692 (gfc_trans_allocate): Convert result to target type.
693 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
694 pointer-to-member structures shall have alias set zero as well.
696 2007-08-20 Richard Guenther <rguenther@suse.de>
698 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
700 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
701 (nonstatic_local_decl_p): Likewise.
702 * tree.c (cp_auto_var_in_fn_p): Remove.
703 * decl.c (nonstatic_local_decl_p): Remove.
705 2007-08-20 Richard Guenther <rguenther@suse.de>
707 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
709 * tree.h (cp_walk_tree): New define to walk_tree_1 with
710 cp_walk_subtrees lh parameter.
711 (cp_walk_tree_without_duplicates): New define to
712 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
713 * tree.c (count_trees): Call
714 cp_walk_tree_without_duplicates.
715 (verify_stmt_tree): Call cp_walk_tree.
716 (break_out_target_exprs): Likewise.
717 (WALK_SUBTREE): Likewise.
718 * cp-gimplify.c (cp_genericize): Likewise.
719 * cp-pt.c (find_parameter_packs_r): Likewise.
720 (uses_parameter_packs): Likewise.
721 (make_pack_expansion): Likewise.
722 (check_for_bare_parameter_packs): Likewise.
723 (for_each_template_parm): Likewise.
724 * decl.c (check_default_argument): Call
725 cp_walk_tree_without_duplicates.
726 * except.c (build_throw): Likewise.
727 * decl2.c (type_visibility): Likewise.
728 * semantics.c (expand_or_defer_fn): Likewise.
729 (finalize_nrv): Call cp_walk_tree.
731 2007-08-20 Jakub Jelinek <jakub@redhat.com>
734 * init.c (build_new_1): Rename placement_var variable to placement_expr.
735 Initialize it with save_expr rather than get_temp_regvar.
737 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
740 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
743 2007-08-17 Ollie Wild <aaw@google.com>
746 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
747 declarations into appropriate slots for comparison. Fix type
750 2007-08-17 Paolo Carlini <pcarlini@suse.de>
753 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
754 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
756 2007-08-17 Paolo Carlini <pcarlini@suse.de>
759 * parser.c (cp_parser_class_head): Improve error message.
761 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
763 * pt.c (instantiate_decl): Set input_location
764 for the function end.
766 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
768 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
770 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
771 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
772 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
773 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
774 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
775 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
776 * typeck.c (cp_type_quals): Likewise.
777 * typeck2.c (cxx_incomplete_type_diagnostic,
778 cxx_incomplete_type_error): Likewise.
780 2007-08-16 Paolo Carlini <pcarlini@suse.de>
783 * pt.c (tsubst_friend_function): When check_classfn
784 returns error_mark_node likewise return it.
786 2007-08-15 Jakub Jelinek <jakub@redhat.com>
789 * typeck.c (check_return_expr): Don't NRV optimize vars in
791 * decl.c (finish_function): Comment fix.
793 2007-08-15 Paolo Carlini <pcarlini@suse.de>
796 * pt.c (push_template_decl_real): Depending on TYPE_P
797 use either TYPE_CONTEXT or DECL_CONTEXT.
799 2007-08-14 Mark Mitchell <mark@codesourcery.com>
801 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
802 constructors and destructors return this.
804 2007-08-14 Paolo Carlini <pcarlini@suse.de>
807 * decl2.c (check_classfn): Return error_mark_node in case of error;
808 in that case, do not call add_method.
809 * decl.c (start_decl): Deal with check_classfn returning
811 (grokfndecl): Likewise.
812 * pt.c (tsubst_friend_function): Likewise.
814 2007-08-14 Andrew Pinski <pinskia@gmail.com>
817 * typeck.c (build_binary_op): Disallow vector float types with
818 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
820 2007-08-11 Ian Lance Taylor <iant@google.com>
822 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
824 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
826 2007-08-10 Ollie Wild <aaw@google.com>
828 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
830 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
832 (unqualified_namespace_lookup): Fix ambiguous_decl call.
833 (lookup_using_namespace): Fix ambiguous_decl call.
834 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
836 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
838 * call.c (name_as_c_string): Use CONST_CAST.
839 * decl.c (build_decl): Likewise.
840 * parser.c (cp_parser_string_literal): Likewise.
842 2007-08-10 Paolo Carlini <pcarlini@suse.de>
845 * error.c (dump_expr): Consistently use the *_cxx_*
846 variants of the pretty-print functions.
848 2007-08-10 Paolo Carlini <pcarlini@suse.de>
851 * decl.c (check_special_function_return_type): Just error
852 on return type specified for conversion operator.
854 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
856 * typeck2.c (readonly_error): Handle general expressions.
857 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
859 2007-08-06 Dan Hipschman <dsh@google.com>
861 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
862 access function name.
864 2007-08-04 Alfred Minarik <a.minarik@aon.at>
867 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
868 * g++spec.c (lang_specific_driver): Check them.
870 2007-08-06 Paolo Carlini <pcarlini@suse.de>
873 * pt.c (inline_needs_template_parms): Fix comment; change return type
876 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
879 2007-03-26 Dirk Mueller <dmueller@suse.de>
881 * parser.c (cp_parser_member_declaration): Pedwarn
882 about stray semicolons after member declarations.
884 2007-08-02 Lee Millward <lee.millward@gmail.com>
889 * parser.c (cp_parser_asm_definition): Detect and discard asm
890 statements with invalid inputs or outputs.
891 (cp_parser_asm_operand_list): Return error mark node if any
892 of the operands are invalid. Adjust documentation.
894 2007-08-02 Nick Clifton <nickc@redhat.com>
896 * typeck.c: Change copyright header to refer to version 3 of the
897 GNU General Public License and to point readers at the COPYING3
898 file and the FSF's license web page.
899 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
900 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
901 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
902 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
903 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
904 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
905 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
906 name-lookup.h, parser.c: Likewise.
908 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
911 * call.c (magic_varargs_p): Honor the "type generic" attribute.
913 2007-07-30 Paolo Carlini <pcarlini@suse.de>
916 * semantics.c (finish_label_stmt): Reject the __label__
917 extension outside function scopes.
919 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
921 * parser.c (eof_token): Un-constify.
922 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
923 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
926 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
928 * pt.c, tree.c, typeck2.c: Fix comment typos.
930 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
931 Mark Mitchell <mark@codesourcery.com>
934 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
935 hidden due to friend declarations in local classes.
937 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
939 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
940 * cp-tree.def (DECLTYPE_TYPE): New.
941 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
942 (dump_type_prefix): Ditto.
943 (dump_type_suffix): Ditto.
944 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
945 * mangle.c (write_type): Handle DECLTYPE_TYPE.
946 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
948 (DECLTYPE_TYPE_EXPR): New.
949 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
950 (finish_declared_type): Declare.
951 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
953 (pp_cxx_type_id): Ditto.
954 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
955 (tsubst): Substitute into a DECLTYPE_TYPE node.
956 (tsubst_copy): Ditto.
957 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
959 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
960 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
961 structural equality (because we can't hash the expressions).
962 (finish_declared_type): New.
963 * lex.c (reswords): Add "decltype" keyword.
964 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
965 (cp_parser_postfix_expression): Add member_access_only_p to
966 restrict postfix expression to member access expressions.
967 (cp_parser_unary_expression): Update call to
968 cp_parser_postfix_expression to reflect new parameter.
969 (cp_parser_declared_type): New.
970 (cp_parser_simple_type_specifier): Parse decltype types.
972 2007-07-27 Mark Mitchell <mark@codesourcery.com>
975 * call.c (convert_for_arg_passing): Only widen bitfields to their
976 declared types if necessary.
978 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
980 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
983 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
985 * decl.c (typename_hash, typename_compare): Constify.
986 * mangle.c (hash_type, compare_type): Likewise.
987 * pt.c (eq_local_specializations, hash_local_specialization):
989 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
990 list_hash): Likewise.
991 * typeck2.c (pat_compare): Likewise.
993 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
995 * method.c (implicitly_declare_fn): Increase alignment if member
996 function pointer format requires it.
998 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1001 * typeck.c (check_return_expr): Do not pass a null argument
1004 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1007 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1010 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1013 * typeck.c (convert_arguments): Only use default args if we have
1017 * typeck.c (structural_comptypes): No need to check
1018 resolve_typename_type return value here.
1019 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1020 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1021 original type rather than error_mark_node in case of failure.
1022 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1023 resolve_typename_type result check.
1024 (cp_parser_direct_declarator, cp_parser_head,
1025 cp_parser_constructor_declarator_p): Likewise.
1027 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1029 * pt.c (template_parms_variadic_p): Remove.
1030 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1032 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1035 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1036 argument to dump_aggr_init_expr_args instead of false.
1038 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1040 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1041 canonical types; otherwise, fall back to structural type
1042 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1043 internal compiler error if the canonical types are wrong.
1045 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1048 * parser.c (cp_parser_make_indirect_declarator): When the
1049 the code argument is ERROR_MARK return cp_error_declarator.
1051 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1054 * decl.c (cxx_init_decl_processing): Don't set
1055 force_align_functions_log.
1056 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1057 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1058 FUNCTION_DECL, return its alignment.
1060 2007-07-09 Richard Guenther <rguenther@suse.de>
1062 * decl.c (start_preparsed_function): Do not promote return type.
1064 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1067 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1069 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1072 * pt.c (resolve_overloaded_unification): Robustify. Return a
1074 (type_unification_real): Adjust accordingly.
1076 2007-07-06 Richard Guenther <rguenther@suse.de>
1078 * init.c (build_new_1): Use the correct pointer type.
1079 * typeck2.c (build_m_component_ref): Likewise.
1081 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1084 * init.c (build_zero_init): Always build an initializer for
1086 * typeck2.c (build_functional_cast): Use build_zero_init.
1089 * init.c (build_new_1): Always pass the allocation function to
1090 build_op_delete_call.
1091 * call.c (build_op_delete_call): Handle operator delete with a
1092 variable-argument list. Do not issue an error when no matching
1093 deallocation function is available for a new operator.
1096 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1097 * decl.c (value_dependent_init_p): New function.
1098 (cp_finish_decl): Use it.
1099 * pt.c (value_dependent_expression_p): Use
1100 any_value_dependent_elements_p.
1101 * parser.c (cp_parser_primary_expression): Add comment about
1102 treating dependent qualified names as integral
1103 constant-expressions.
1105 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1107 * decl.c (build_ptrmemfunc_type): Always use structural equality
1108 tests when comparing pointer-to-member-function types, because the
1109 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1112 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1114 * init.c (build_new): Tweak comment.
1116 2007-06-29 Dave Brolley <brolley@redhat.com>
1119 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1120 type to its base type and number of elements here.
1121 * init.c (build_new): Call complete_type_or_else to ensure that the
1122 type is complete and to issue a diagnostic if it is not.
1123 (build_new_1): Don't call complete_type_or_else here.
1125 2007-07-03 Richard Guenther <rguenther@suse.de>
1128 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1131 2007-07-02 Simon Baldwin <simonb@google.com>
1133 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1134 for inner-style nested forward declarations that don't declare
1137 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1140 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1141 DECL_P in not a variable and appears more than once error messages.
1143 2007-07-01 Ollie Wild <aaw@google.com>
1145 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1146 (select_decl): Remove function.
1147 (unqualified_namespace_lookup): Populate binding by calling
1148 ambiguous_decl. Remove select_decl call.
1149 (lookup_qualified_name): Remove select_decl call.
1150 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1151 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1152 generation when name lookup is ambiguous.
1154 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1157 * init.c (build_new_1): Use structural equality on the copy of the
1160 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1162 * decl2.c (determine_visibility): Implement
1163 flag_visibility_ms_compat effect on type info.
1164 * decl.c (cxx_init_decl_processing): Implement
1165 global effect of flag_visibility_ms_compat.
1167 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1169 * decl2.c (start_objects): Mark constructor-running function
1172 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1175 * decl.c (grokdeclarator): Reset friendp for member functions declared
1176 friend of their own class.
1178 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1180 * decl2.c (determine_visibility): Don't look for dllexport here.
1181 (determine_visibility_from_class): Tidy.
1183 2007-06-18 Simon Baldwin <simonb@google.com>
1186 * parser.c (cp_parser_single_declaration): Added check for storage
1187 class other than sc_none in parsed declaration, and a flag to indicate
1188 if the call is part of an explicit template specialization parse.
1189 * (cp_parser_explicit_specialization): Specialization check flag added
1190 to call to cp_parser_single_declaration(), set true.
1191 * (cp_parser_template_declaration_after_export): Specialization check
1192 flag added to call to cp_parser_single_declaration(), set false.
1193 * pt.c (check_explicit_specialization): Added code to copy visiblity
1194 and linkage from the templated function to the explicit specialization.
1196 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1198 * typeck.c (build_binary_op): For templates build the
1199 expression in pieces to avoid the assert in build2_stat.
1200 (get_member_function_from_ptrfunc):
1201 Change over to using POINTER_PLUS_EXPR and convert
1202 the second operand to sizetype.
1203 * typeck2.c (build_m_component_ref): Likewise.
1204 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1205 instead of PLUS_EXPR for pointers.
1206 (build_new_1): Likewise.
1207 (build_vec_delete_1): Likewise.
1208 (build_vec_delete): Likewise.
1209 * class.c (build_base_path): Likewise.
1210 (build_base_path): Likewise.
1211 (convert_to_base_statically): Likewise.
1212 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1213 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1214 instead of PLUS_EXPR.
1215 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1216 instead of PLUS_EXPR for pointers.
1217 * call.c (build_special_member_call): Likewise.
1218 * rtti.c (build_headof): Likewise.
1219 Use sizetype instead of ptrdiff_type_node.
1220 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1221 instead of PLUS_EXPR for pointers.
1222 * except.c (expand_start_catch_block): Do a
1223 NEGATIVE and then a POINTER_PLUS_EXPR instead
1225 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1226 PLUS_EXPR on pointer types over to use
1227 POINTER_PLUS_EXPR and remove the conversion
1228 to the pointer types.
1229 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1230 adding to a pointer type. Use size_int instead of
1231 ssize_int. Convert the index to sizetype before
1232 adding it to the pointer.
1234 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1236 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1237 (DECL_ANON_UNION_VAR_P): New macro.
1238 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1239 than DECL_VAR_MARKED_P, to keep track of which variables we have
1241 * decl.c (redeclaration_error_message): Complain about redeclaring
1242 anonymous union members at namespace scope.
1243 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1245 2007-06-14 Geoff Keating <geoffk@apple.com>
1247 * decl2.c (determine_visibility): Ensure that functions with
1248 hidden types as parameters are hidden.
1251 * decl2.c (determine_visibility): Remove duplicate code for
1254 2007-06-12 Ian Lance Taylor <iant@google.com>
1257 * init.c (avoid_placement_new_aliasing): New static function.
1258 (build_new_1): Call it.
1260 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1262 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1263 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1265 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1268 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1269 on init, the non-decl cond operand and increment value.
1271 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1274 * decl.c (check_initializer): Report an error when a brace enclosed
1275 initializer is used for a non-aggregate type in C++98.
1276 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1278 (grokdeclarator): Likewise.
1279 (move_fn_p): Likewise.
1280 * typeck.c (check_return_expr): Likewise.
1281 * call.c (reference_binding): Likewise.
1282 * error.c (cp_cpp_error): Likewise.
1283 * pt.c (check_default_tmpl_args): Likewise.
1285 * lex.c (init_reswords): Likewise.
1286 * parser.c (p_parser_primary_expression): Likewise.
1287 (TOKEN_PRECEDENCE): Likewise.
1288 (cp_parser_init_declarator): Likewise.
1289 (cp_parser_ptr_operator): Likewise.
1290 (cp_parser_parameter_declaration): Likewise.
1291 (cp_parser_enclosed_template_argument_list): Likewise.
1292 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1293 (cp_parser_next_token_ends_template_argument_p): Likewise.
1295 2007-06-04 Simon Baldwin <simonb@google.com>
1297 * decl.c (grokdeclarator): Readability change. Moved case labels
1298 into direct switch statement scope.
1300 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1302 * call.c (convert_like_real): Remove pointless code.
1304 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1306 * decl.c (get_atexit_fn_ptr_type): New function.
1307 (get_atexit_node): Use it.
1308 (start_cleanup_fn): Likewise.
1309 (register_dtor_fn): Use the object's destructor, instead of a
1310 separate cleanup function, where possible.
1311 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1312 (atexit_fn_ptr_type_node): New macro.
1313 * decl2.c (build_cleanup): Use build_address.
1315 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1317 * typeck.c (build_binary_op): Include types in error.
1319 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1322 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1323 needs runtime initialization.
1325 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1328 * semantics.c (finish_trait_expr): Complete the types.
1330 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1331 Douglas Gregor <doug.gregor@gmail.com>
1332 Pedro Lamarao <pedro.lamarao@mndfck.org>
1333 Howard Hinnant <howard.hinnant@gmail.com>
1337 * typeck.c (comptypes): Don't consider rvalue and lvalue
1338 reference types to be equivalent.
1339 (check_return_expr): Move from certain lvalues when returning
1341 * decl.c (grokdeclarator): Implement reference collapsing.
1342 (copy_fn_p): Don't consider constructors taking rvalue references
1343 to be copy constructors.
1345 * call.c (conversion): New "rvaluedness_matches_p" member.
1346 (convert_class_to_reference): Require reference type as first
1347 parameter instead of base type.
1348 (reference_binding): Add logic to handle rvalue references.
1349 (implicit_conversion): Update inaccurate comment.
1350 (convert_like_real): Disable creation of temporaries that are
1351 impossible to initialize for types with move constructors.
1352 (build_over_call): Elide move constructors when possible.
1353 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1354 (maybe_handle_ref_bind): Return conversion instead of type node.
1355 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1356 determine preferred conversion sequences.
1357 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1358 (LOOKUP_PREFER_RVALUE): New.
1359 (DECL_MOVE_CONSTRUCTOR_P): New.
1360 (struct cp_declarator): Add "reference" member for reference
1361 types, with new "rvalue_ref" flag.
1362 (cp_build_reference_type): Declare.
1363 (move_fn_p): Declare.
1364 * error.c (dump_type_prefix): Format rvalue reference types
1365 correctly in error messages.
1366 * except.c (build_throw): Move from certain lvalues when
1368 * mangle.c (write_type): Mangle rvalue references differently
1369 than regular references.
1370 * parser.c (make_reference_declarator): Add boolean parameter for
1372 (cp_parser_make_indirect_declarator): New.
1373 (cp_parser_new_declarator_opt): Call
1374 cp_parser_make_indirect_declarator.
1375 (cp_parser_conversion_declarator_opt): Ditto.
1376 (cp_parser_declarator): Ditto.
1377 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1379 * pt.c (tsubst): Implement reference collapsing.
1380 (maybe_adjust_types_for_deduction): Implement special template
1381 parameter deduction rule for rvalue references.
1382 (type_unification_real): Update calls to
1383 maybe_adjust_types_for_deduction.
1384 (try_one_overload): Ditto.
1385 (unify_pack_expansion): Ditto.
1386 * tree.c (lvalue_p_1): Handle rvalue reference types.
1387 (cp_build_reference_type): New.
1389 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1392 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1393 variables that need runtime initialization.
1395 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1398 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1399 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1400 case POSTDECREMENT_EXPR>): Return the error_mark_node
1401 if either the real or imaginary parts would an
1404 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1405 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1408 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1409 token is a closing brace, false if there are no tokens left.
1410 (cp_parser_namespace_alias_definition): Only consume the next token if
1411 it is a closing brace.
1413 * parser.c (cp_parser_class_specifier): Likewise.
1415 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1417 * semantics.c (finish_member_declaration): Fix a typo in the
1420 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1432 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1433 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1434 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1435 whether everything was okay. Fix indentation.
1436 (push_template_decl_real): Check for bare parameter packs in
1437 function parameters; where errors occur, mark the parameter types
1438 with ERROR_MARK_NODEs to avert ICEs.
1439 (coerce_template_parameter_pack): New.
1440 (coerce_template_parms): Moved parameter pack coercion into
1441 coerce_template_parameter_pack, and permit it anywhere in the
1442 template parameter list (not just at the end). Parameter and
1443 argument indices can vary (somewhat) separately now, so add
1444 PARM_IDX and ARG_IDX.
1445 (fn_type_unification): Don't set an argument pack as incomplete if
1446 no argument pack was deduced.
1447 (type_unification_real): If a type parameter is a parameter pack
1448 and has not otherwise been deduced, it will be deduced to an empty
1450 (more_specialized_fn): Use the actual lengths of the argument
1451 lists when comparing against expansions.
1452 * semantics.c (finish_member_declaration): If a field's type has
1453 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1455 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1458 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1460 2007-05-22 Ollie Wild <aaw@google.com>
1462 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1463 (unqualified_namespace_lookup): Adds check for hidden types.
1465 2007-05-22 Ollie Wild <aaw@google.com>
1467 * decl.c (duplicate_decls): Verify namespace names are unique.
1469 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1471 * decl.c (cxx_maybe_build_cleanup): Handle
1472 __attribute__((cleanup)).
1474 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1476 * cvt.c (cp_convert_and_check): Don't check warnings if the
1479 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1481 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1483 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1486 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1487 type only if is a class type (5.2.8/4).
1489 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1491 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1492 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1493 c_common_unsigned_type.
1495 2007-05-11 Silvius Rus <rus@google.com>
1497 * cp/typeck.c (build_indirect_ref): Add call to
1498 strict_aliasing_warning.
1499 (build_reinterpret_cast_1): Condition call to
1500 strict_aliasing_warning.
1502 2007-05-11 Jan Hubicka <jh@suse.cz>
1504 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1505 * decl2.c (start_objects): ctors and dtors are no longer public.
1506 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1508 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1510 * typeck.c (build_unary_op): Remove code that used to
1511 handle non lvalue increments/decrements.
1513 2007-05-07 Mike Stump <mrs@apple.com>
1515 * parser.c (check_empty_body): Add.
1516 (cp_parser_iteration_statement): Add call to check_empty_body.
1518 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1521 * mangle.c (write_mangled_name): Mangle static variable names.
1522 (write_unqualified_name): Use local-source-name for
1523 namespace-scope static variables.
1525 2007-05-04 Dirk Mueller <dmueller@suse.de>
1527 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1530 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1533 * decl2.c (constrain_class_visibility):
1534 Use strip_pointer_or_array_types instead of strip_array_types.
1536 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1539 * decl.c (reshape_init_r): Don't reshape the first element if it
1540 is a pointer to member function.
1542 2007-04-27 Simon Baldwin <simonb@google.com>
1544 * decl.c (grokparms): Changed message format from %qD to %qE.
1546 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1548 * error.c (maybe_warn_variadic_templates): Variadic templates are
1549 now in C++0x, so only warn about them in C++98 mode.
1551 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1554 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1555 integeral types from vectors types.
1557 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1560 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1561 for type dependent OMP_CLAUSE_DECLs.
1563 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1566 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1567 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1568 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1569 * init.c (build_zero_init): Adjust, as
1570 COMPLEX_TYPE is now a SCALAR_TYPE.
1571 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1572 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1574 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1576 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1577 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1578 (trait_expr_value): Adjust.
1580 2007-04-23 Simon Baldwin <simonb@google.com>
1582 * decl.c (grokparms): Added new error for duplicate function
1583 parameters names in function prototypes, to match gcc behavior.
1585 2007-04-23 Jan Hubicka <jh@suse.cz>
1587 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1590 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1592 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1593 instead of checking GIMPLE_STMT_P in chain_next.
1595 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1598 * call.c (convert_for_arg_passing): Convert bitfields to their
1601 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1604 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1606 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1609 * cp/decl2.c (constrain_class_visibility):
1610 Do not warn about the use of anonymous namespace in the main input file.
1612 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1614 * cp-tree.h (current_template_parms): Fix typo in comment.
1616 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1618 * cp-tree.h, error.c: Fix comment typos.
1620 2007-04-13 Jason Merrill <jason@redhat.com>
1623 * call.c (reference_binding): Add c_cast_p parm. If true,
1624 add quals to TO as needed to make it reference-compatible.
1626 2007-04-11 Jan Hubicka <jh@suse.cz>
1628 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1629 that we are not processing template_decl.
1631 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1634 * class.c (build_base_path): Ensure that the converted pointer has
1635 the same cv-qualification as the input.
1637 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1639 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1641 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1643 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1645 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1646 * tree.c (cp_add_pending_fn_decls): Remove.
1647 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1649 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1651 Revert change removing staticp.
1653 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1655 * cp-objcp-common.c (cxx_staticp): Remove.
1656 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1657 * cp-tree.h (cxx_staticp):
1659 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1661 * class.c (check_for_override): Don't remove dllmport attribute
1664 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1667 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1668 type issue error and return early.
1670 2007-03-30 Jason Merrill <jason@redhat.com>
1673 * typeck.c (cp_type_readonly): New fn.
1674 * cp-tree.h: Declare it.
1675 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1676 (cp_finish_decl): Not here.
1678 2007-03-31 Richard Guenther <rguenther@suse.de>
1680 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1683 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1688 * parser.c (declarator_can_be_parameter_pack): New.
1689 (cp_parser_template_parameter): Only parse the `...' if the
1690 declarator can be a parameter pack.
1691 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1693 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1694 types (they could be used as array bounds).
1695 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1696 (tsubst_pack_expansion): Handle failure to expand parameter
1699 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1702 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1703 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1704 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1705 (CLASS_TYPE_NON_UNION_P): Add.
1706 (struct lang_type_class): Add has_complex_dflt.
1707 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1708 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1709 * cp-tree.def: Add TRAIT_EXPR.
1710 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1711 * lex.c (struct resword): Add __has_nothrow_assign,
1712 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1713 __has_trivial_constructor, __has_trivial_copy,
1714 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1715 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1716 __is_pod, __is_polymorphic, __is_union.
1717 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1718 (cp_parser_trait_expr): New.
1719 * semantics.c (finish_trait_expr, trait_expr_value
1720 classtype_has_nothrow_copy_or_assign_p): New.
1721 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1723 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1724 * class.c (check_bases, check_field_decl, check_bases_and_members):
1725 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1726 * pt.c (uses_template_parms, tsubst_copy_and_build,
1727 value_dependent_expression_p, type_dependent_expression_p): Deal with
1729 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1731 2007-03-29 Richard Guenther <rguenther@suse.de>
1733 * tree.c (cp_walk_subtrees): Do not set input_location.
1735 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1738 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1741 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1743 * parser.c (struct cp_parser): Update comment for
1744 greater_than_is_operator_p.
1745 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1746 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1747 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1748 !GREATER_THAN_IS_OPERATOR_P.
1749 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1750 `>>' operators that will become two `>' tokens in C++0x.
1751 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1752 mode, allowing it to terminate default arguments.
1753 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1754 `>>' like two consecutive `>' tokens.
1755 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1756 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1757 ends a template argument.
1759 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1761 * decl.c (redeclaration_error_message): Complain when redeclaring
1762 a friend function with default template arguments (C++0x mode only).
1763 * cp-tree.h (check_default_tmpl_args): Declare.
1764 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1765 template arguments in function templates. Add support for checking
1766 the default template arguments of friend templates.
1767 (push_template_decl_real): Fix call to check_default_tmpl_args.
1768 (type_unification_real): If a template parameter has not been
1769 deduced but provides a default template argument, substitute into
1770 that default template argument.
1771 * parser.c (cp_parser_init_declarator): When declaring (but not
1772 defining!) a function template in C++0x mode, check for default
1775 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1778 * decl.c (grokdeclarator): Deal with cv-qualified function type
1779 typedefs in the same way for member and non-member functions.
1781 2007-03-26 Dirk Mueller <dmueller@suse.de>
1783 * parser.c (cp_parser_member_declaration): Pedwarn
1784 about stray semicolons after member declarations.
1786 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1789 * pt.c (instantiate_decl): Set in_system_header.
1791 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1793 * cp-tree.h (current_tempalte_parms): Improve documentation.
1794 * pt.c (current_template_args): Likewise.
1797 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1798 not consume tokens when failing.
1800 2007-03-22 Jim Wilson <wilson@specifix.com>
1801 Mark Mitchell <mark@codesourcery.com>
1804 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1805 consistent with FROM.
1807 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1809 * error.c (dump_expr): Handle dependent names that designate types.
1810 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1812 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1814 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1816 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1818 * cvt.c (cp_convert_and_check) : Define.
1819 * cp-tree.h (cp_convert_and_check): Declare.
1820 * call.c (convert_conversion_warnings): Rename to
1821 conversion_null_warnings. The warning for floating-point to
1822 integer is handled by convert_and_check in convert_like_real.
1823 (convert_like_real): convert_conversion_warnings was renamed as
1824 conversion_null_warnings.
1825 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1826 overflow and changes of value during conversion.
1828 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1831 * parser.c (cp_parser_statement): If 'namespace' is found, this
1832 only can be a namespace alias definition, so parse it now.
1833 (cp_parser_namespace_alias_definition): if we find an open brace
1834 instead of '=', then this is actually a misplaced namespace
1837 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1840 * decl.c (cxx_init_decl_processing): Move command-line options
1841 processing to c-opts.c.
1843 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1845 * ptree.c (cxx_print_type): Use formatting markup for integers
1846 when printing template parameter index/level/orig level.
1847 (cxx_print_xnode): Ditto.
1848 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1849 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1850 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1852 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1853 rather than a HOST_WIDE_INT.
1854 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1855 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1857 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1858 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1859 IN_BASE_INITIALIZER bool bitfields.
1860 (struct cp_declarator): Make KIND a 4-bit field. Make
1861 PARAMETER_PACK_P a bool bitfield just after KIND.
1862 * pt.c (uses_parameter_packs): Destroy the pointer set.
1863 (make_pack_expansion): Ditto.
1864 (check_for_bare_parameter_packs): Ditto.
1865 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1867 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1870 * call.c (convert_default_arg): Instead of copying the node,
1873 2007-03-15 Dirk Mueller <dmueller@suse.de>
1876 * call.c (convert_conversion_warnings): New..
1877 (convert_like_real): .. factored out from here.
1878 (convert_conversion_warnings): Add warning about
1879 false being converted to NULL in argument passing.
1881 2007-03-14 Dirk Mueller <dmueller@suse.de>
1883 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1884 (finish_do_body): Warn about empty body in do/while statement.
1886 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1888 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1890 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1893 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1896 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1898 * cp/repo.c (init_repo): Initialize random_seed saved options.
1899 (finish_repo): Adjust.
1901 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1904 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1907 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1909 * decl.c (compute_array_index_type): New warning flag warn_vla.
1911 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1914 * call.c (convert_default_arg): Copy non-constant arguments.
1916 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1919 * parser.c (cp_parser_postfix_expression): Disallow compound
1920 literals in constant expressions.
1923 * semantics.c (finish_typeof): Use unlowered_expr_type.
1925 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1928 * cp-tree.h (unlowered_expr_type): New function.
1929 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1930 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1931 (unlowered_expr_type): New function.
1932 (build_unary_op): Disallow predecrements of bool bitfields.
1933 * call.c (build_conditional_expr): Use unlowered_expr_type.
1934 * pt.c (type_unification_real): Likewise.
1936 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1939 * typeck.c (check_return_expr): Check for bare parameter packs.
1940 (comptypes): Compare template parameter packs and
1941 type pack expansions.
1942 * decl.c (grokdeclarator): Deal with the declaration of function
1944 (grokparms): Verify that the (optional) function parameter pack is
1945 at the end of the parameter list.
1946 (xref_basetypes): Handle pack expansions in the base class.
1947 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1948 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1949 (NONTYPE_ARGUMENT_PACK): New.
1950 (TYPE_PACK_EXPANSION): New.
1951 (EXPR_PACK_EXPANSION): New.
1952 (ARGUMENT_PACK_SELECT): New.
1953 * cp-objcp-common.c (cp_tree_size): Compute size of
1954 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1955 ARGUMENT_PACK_SELECT.
1956 * error.c (dump_template_argument): Print template argument packs.
1957 (dump_template_argument_list): Ditto.
1958 (dump_template_parameter): Dump `...' for template type parameter
1960 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1961 (dump_parameters): Print function parameter packs.
1962 (dump_template_parms): Print template argument packs.
1963 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1964 (maybe_warn_variadic_templates): New.
1965 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1966 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1967 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1969 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1970 (write_template_arg): Write argument packs as separate arguments.
1971 * cp-tree.h (struct template_parm_index_s): Add flag that
1972 indicates that the template parameter is actually a parameter
1974 (struct tree_argument_pack_select): New.
1975 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1976 (union lang_tree_node): Add argument_pack_select.
1977 (FUNCTION_PARAMETER_PACK_P): New.
1978 (PACK_EXPANSION_P): New.
1979 (PACK_EXPANSION_PATTERN): New.
1980 (SET_PACK_EXPANSION_PATTERN): New.
1981 (PACK_EXPANSION_PARAMETER_PACKS): New.
1982 (ARGUMENT_PACK_P): New.
1983 (ARGUMENT_PACK_ARGS): New.
1984 (SET_ARGUMENT_PACK_ARGS): New.
1985 (ARGUMENT_PACK_INCOMPLETE_P): New.
1986 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1987 (TEMPLATE_PARM_PARAMETER_PACK): New.
1988 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1989 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1990 (ARGUMENT_PACK_SELECT_INDEX): New.
1991 (ARGUMENT_PACK_SELECT_ARG): New.
1992 (struct cp_declarator): Add parameter_pack_p flag.
1993 (maybe_warn_variadic_templates): Declare.
1994 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1995 indicate a template parameter pack.
1996 (uses_parameter_packs): Declare.
1997 (template_parameter_pack_p): Declare.
1998 (template_parms_variadic_p): Declare.
1999 (make_pack_expansion): Declare.
2000 (check_for_bare_parameter_packs): Declare.
2001 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2002 sizeof... expressions.
2003 (pp_cxx_expression): Print pack expansions and non-type argument
2005 (pp_cxx_exception_specification): Print pack expansions.
2006 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2007 (pp_cxx_ctor_initializer): Print pack expansions.
2008 (pp_cxx_type_id): Print pack expansions.
2009 (pp_cxx_template_argument_list): Print argument packs.
2010 (pp_cxx_template_parameter): Print ellipsis for template parameter
2012 * pt.c (comp_template_parms): Compare template parameter packs.
2013 (template_parameter_pack_p): New.
2014 (template_parms_variadic_p): New.
2015 (template_args_variadic_p): New.
2016 (make_ith_pack_parameter_name): New.
2017 (struct find_parameter_pack_data): New.
2018 (find_parameter_packs_r): New.
2019 (uses_parameter_packs): New.
2020 (make_pack_expansion): New.
2021 (check_for_bare_parameter_packs): New.
2022 (expand_template_argument_pack): New.
2023 (reduce_template_parm_level): Propagate parameter pack flag.
2024 (process_template_parm): Add is_parameter_pack parameter to state
2025 when the parameter is actually a parameter pack. Create template
2026 parameter packs when is_parameter_pack is true.
2027 (current_template_args): The argument for a template parameter
2028 pack is an argument pack containing a single pack expansion.
2029 (process_partial_specialization): When checking that non-type
2030 argument expressions do not involve template parameters, loop over
2031 the arguments in argument packs separately.
2032 (push_template_decl_real): Check that the type of the declaration
2033 does not have any bare parameter packs. Check that primary
2034 templates have no more than one parameter pack, and that it comes
2035 at the end of the template parameter list.
2036 (convert_template_argument): Handle coercions for pack expansion
2037 expressions by coercing the pattern then rebuilding the expansion.
2038 (coerce_template_parms): When coercing the arguments for a
2039 variadic template, pack "extra" arguments into an argument pack.
2040 (coerce_template_template_parms): Cannot coerce between parameter
2041 packs and non-pack parameters.
2042 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2043 (comp_template_args): Expand all template arguments packs before
2044 comparing template argument lists.
2045 (mangle_class_name_for_template): Make argument packs as separate
2047 (for_each_template_parm_r): No need to handle BASELINK.
2048 (instantiate_class_template): Handle pack expansions in the base
2050 (tsubst_pack_expansion): New.
2051 (tsubst_template_args): Handle substitutions of argument packs and
2052 pack expansion into template argument lists.
2053 (tsubst_decl): Expand function parameter packs into separate
2054 function parameters.
2055 (tsubst_arg_types): Expand a type pack expansion into separate
2057 (tsubst_exception_specification): Handle pack expansions in
2058 exception specifiers.
2059 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2060 replacing a template parameter with its argument. If we encounter
2061 a substitution for an argument pack, just return the parameter
2063 (tsubst_copy): sizeof(X...) returns the number of elements in
2064 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2065 PARM_DECL is a parameter pack.
2066 (tsubst_expr): Expression pack expansions and argument packs
2067 cannot show up here; they will all be handled through function
2068 calls, sizeof, and template argument lists.
2069 (tsubst_copy_and_build): sizeof(X...) returns the number of
2070 elements in parameter pack X. Handle pack expansions in TREE_LIST
2071 and CONSTRUCTOR nodes.
2072 (fn_type_unification): Handle "incomplete" explicit template
2073 argument lists that specify some of the arguments for a template
2075 (type_unification_real): Unify arguments against pack expansions.
2076 (template_parm_level_and_index): New, helper function.
2077 (unify_pack_expansion): New.
2078 (unify): Unify argument packs on an argument-by-argument basis,
2079 handling variadic argument packs as well.
2080 (more_specialized_fn): Handle unification of function parameter
2081 packs. All things being equal, prefer non-variadic function
2082 templates to variadic function templates.
2083 (more_specialized_class): Prefer the variadic class template
2084 partial specialization that binds fewer arguments to a parameter
2086 (regenerate_decl_from_template): Expand function parameter packs
2087 into separate parameters.
2088 (instantiate_decl): Ditto.
2089 (tsubst_initializer_list): Handle pack expansions for base-class
2091 (dependent_type_p_r): Determine dependent types in argument packs
2092 and pack expansions.
2093 (value_dependent_expression_p): Determine value-dependence of
2094 non-type argument packs.
2095 (dependent_template_arg_p): Handle argument packs.
2096 * semantics.c (finish_cond): Check for bare parameter packs.
2097 (finish_expr_stmt): Ditto.
2098 (finish_for_expr): Ditto.
2099 (finish_switch_cond): Ditto.
2100 (finish_mem_initializers): Ditto.
2101 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2103 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2104 * parser.c (make_declarator): Declarator is not an expansion.
2105 (make_pointer_declarator): Transfer parameter pack flag to outer
2107 (make_reference_declarator): Ditto.
2108 (make_ptrmem_declarator): Ditto.
2109 (make_call_declarator): Ditto.
2110 (make_array_declarator): Ditto.
2111 (cp_parser_postfix_expression): Allow pack expansion expressions
2112 in the argument list for a call expression.
2113 (cp_parser_parenthesized_expression_list): Add new parameter
2114 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2115 into separate arguments."
2116 (cp_parser_new_placement): Allow pack expansion expressions.
2117 (cp_parser_new_initializer): Ditto.
2118 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2119 base-class initializer expansion.
2120 (cp_parser_mem_initializer): Ditto.
2121 (cp_parser_template_parameter_list): Keep track of whether the
2122 template parameter is a template parameter pack.
2123 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2124 template parameter pack.
2125 (cp_parser_type_parameter): Ditto.
2126 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2128 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2129 this declarator is a parameter pack.
2130 (cp_parser_parameter_declaration): The ellipsis does not end the
2131 parameter declaration, because it might be a parameter pack. Parse
2132 the ellipsis to indicate a parameter pack.
2133 (cp_parser_initializer): Allow pack expansions.
2134 (cp_parser_initializer_list): Allow ellipsis to create an
2135 initializer expansion.
2136 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2138 (cp_parser_type_id_list): Allow ellipsis to create an exception
2139 specifier expansion.
2140 (cp_parser_attribute_list): Don't allow pack expansions.
2141 (cp_parser_functional_cast): Allow pack expansions.
2142 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2143 compute the length of a parameter pack.
2144 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2145 end a template argument.
2146 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2147 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2150 2007-03-09 Dirk Mueller <dmueller@suse.de>
2152 * cp/call.c (build_new_op): Call warn_logical_operator.
2154 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2157 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2160 * pt.c (any_template_arguments_need_structural_equality_p):
2163 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2165 * decl.c (grokdeclarator): Disable warnings for anonymous
2168 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2170 * typeck2.c (readonly_error): Always emit a hard error.
2171 Remove last argument.
2172 * cp-tree.h (readonly_error): Adjust prototype.
2173 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2174 * typeck.c (build_unary_op): Likewise.
2175 (build_modify_expr): Likewise.
2177 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2180 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2182 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2185 * parser.c (struct cp_parser): New IN_IF_STMT.
2186 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2187 returning if parsing the body of an 'if' statement or issuing an
2188 error and continuing.
2189 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2191 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2193 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2196 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2199 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2201 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2202 Objective-C++. Don't exit early if -shared-libgcc needs to be
2205 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2207 * typeck.c (common_base_type): Delete unused function.
2209 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2211 * Make-lang.in: Add dummy lang.install-pdf target.
2213 2007-03-01 Simon Baldwin <simonb@google.com>
2216 * decl.c (check_tag_decl): Added new warning for typedef ignored
2217 when it precedes an otherwise valid non-typedef declaration.
2219 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2221 * typeck.c (build_function_call): Store converted arguments
2222 in a stack-allocated array instead of building a list.
2223 (convert_arguments): Store arguments in the array passed in as an
2224 argument, and return the actual number of arguments.
2225 * call.c (build_call): Delete, and replace with...
2226 (build_call_n, build_call_a): New.
2227 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2228 (build_over_call): Store converted arguments in a stack-allocated
2229 array instead of building a list.
2230 (build_cxx_call): Pass arguments in an array instead of as a list.
2231 (build_java_interface_fn_ref): Rewrite to avoid constructing
2233 * tree.h: Update declarations to reflect above changes.
2234 * method.c (use_thunk): Use a stack-allocated array to hold
2235 the arguments instead of a list.
2236 * rtti.c (throw_bad_cast): Update call to cxx_call.
2237 (throw_bad_typeid): Likewise.
2238 (build_dynamic_cast_1): Likewise.
2239 * init.c (build_builtin_delete_call): Use build_call_n.
2240 * decl.c (expand_static_init): Likewise.
2241 * except.c (cp_protect_cleanup_actions): Likewise.
2242 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2243 (gimplify_must_not_throw_expr): Likewise.
2244 (cxx_omp_apply_fn): Use build_call_a.
2246 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2248 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2249 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2251 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2253 * cp-tree.h (static_ctors): Remove.
2254 * cp-tree.h (static_dtors): Likewise.
2255 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2256 refactoring of tree_map hierarchy.
2257 (decl_shadowed_for_var_insert): Likewise.
2258 * semantics.c (expand_body): Use c_expand_body.
2259 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2260 * decl2.c (static_ctors): Remove.
2261 (static_dtors): Likewise.
2262 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2263 objc_generate_static_init_call. Do not call static_[cd]tors.
2264 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2266 (cp_write_global_declarations): Likewise.
2268 2007-02-23 Richard Guenther <rguenther@suse.de>
2270 * class.c (note_name_declared_in_class): Make declaration
2271 changes meaning a pedwarn.
2273 2007-02-22 Michael Matz <matz@suse.de>
2276 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2277 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2278 dump_function_decl): Guard emitting outer scopes by new flag.
2279 * cp-lang.c (cxx_dwarf_name): New function.
2280 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2281 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2283 (push_template_decl_real, lookup_template_class): Remove calls
2286 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2288 * call.c (build_new_method_call): Ensure that explicit calls of
2289 destructors have type "void".
2291 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2293 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2294 and -Walways-true with -Waddress.
2295 * cvt.c (convert_to_void): Replace unconditional warning with
2298 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2300 * decl.c, tree.c: Fix comment typos.
2302 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2305 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2306 statement expression if we had an error mark node.
2308 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2309 Brooks Moses <brooks.moses@codesourcery.com>
2310 Lee Millward <lee.millward@codesourcery.com>
2312 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2313 Change class to tcc_vl_exp.
2315 * call.c (build_call): Use build_call_list instead
2317 (build_over_call): Likewise.
2318 (build_new_method_call): Use build_min_non_dep_call_list
2319 instead of build_min_non_dep.
2321 * error.c (dump_call_expr_args): New function.
2322 (dump_aggr_init_expr_args): New function.
2323 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2324 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2326 * cvt.c (convert_to_void): Use build_call_array instead
2327 of build3; use new AGGR_INIT_EXPR accessor macros.
2329 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2330 instead of TREE_CODE_LENGTH.
2332 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2333 AGGR_INIT_EXPR accessor macros.
2335 * cp-gimplify.c (cp_gimplify_init_expr): Use
2336 AGGR_INIT_EXPR_SLOT to set the slot operand.
2338 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2339 (AGGR_INIT_EXPR_SLOT): New macro.
2340 (AGGR_INIT_EXPR_ARG): New macro.
2341 (aggr_init_expr_nargs): New macro.
2342 (AGGR_INIT_EXPR_ARGP): New macro.
2343 (aggr_init_expr_arg_iterator): New.
2344 (init_aggr_init_expr_arg_iterator): New.
2345 (next_aggr_init_expr_arg): New.
2346 (first_aggr_init_expr_arg): New.
2347 (more_aggr_init_expr_args_p): New.
2348 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2349 (stabilize_aggr_init): New declaration.
2350 (build_min_non_dep_call_list): Likewise.
2352 * tree.c (process_aggr_init_operands): New function.
2353 (build_aggr_init_array) New function.
2354 (build_cplus_new): Update to use new CALL_EXPR and
2355 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2356 build_aggr_init_array.
2357 (build_min_non_dep_call_list) New function.
2358 (build_min_nt): Assert input code parameter is not a variable
2359 length expression class.
2360 (build_min, build_min_non_dep): Likewise.
2361 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2362 to check for equality instead of recursing. Handle tcc_vl_exp
2364 (stabilize_call): Update to only handle CALL_EXPRs, not
2365 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2366 (stabilize_aggr_init): New function.
2367 (stabilize_init): Use it.
2369 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2370 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2371 AGGR_INIT_EXPR accessor macros and argument iterators.
2373 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2374 build_vl_exp. Iterate through the operands, recursively
2375 processing each one.
2376 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2377 CALL_EXPR accessor macros.
2378 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2379 tree code classes. Use TREE_OPERAND_LENGTH instead of
2382 * semantics.c (finish_call_expr): Use build_nt_call_list
2383 instead of build_nt.
2384 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2385 accessor macros. Use build_call_array to construct the
2386 CALL_EXPR node instead of build3
2388 * decl2.c (build_offset_ref_call_from_tree): Use
2389 build_nt_call_list and build_min_non_dep_call_list instead
2390 of build_min_nt and build_min_non_dep.
2392 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2393 Use build_nt_call_list instead of build_min_nt.
2395 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2398 * call.c (build_conditional_expr): Improve error message.
2400 2007-02-13 Dirk Mueller <dmueller@suse.de>
2402 * friend.c (do_friend): Annotate warning about friend
2403 declarations in templates with OPT_Wnon_template_friend.
2404 Convert informal message from warning() to inform().
2406 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2407 Mark Mitchell <mark@codesourcery.com>
2410 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2411 instantiations for variables.
2413 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2416 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2417 Check warn_unused_value just once.
2419 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2422 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2423 (fn_type_unificiation): Likewise.
2424 (get_bindings): Likewise.
2426 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2429 * decl.c (finish_function): Use DECL_REPLACEABLE.
2430 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2432 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2434 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2436 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2438 * decl.c (grokvardecl): Don't error if !have_tls.
2439 (grokdeclarator): Likewise.
2440 * parser.c (cp_parser_omp_threadprivate): Likewise.
2442 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2445 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2446 parameters and result decls in omp clauses.
2447 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2450 2007-02-05 Dirk Mueller <dmueller@suse.de>
2453 * parser.c (cp_parser_class_specifier): Always initialize bases.
2455 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2457 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2458 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2459 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2461 * semantics.c (finish_omp_atomic): Store a whole expression node
2462 in operand 1, and integer_zero_node in operand 0, for dependent
2463 OMP_ATOMIC. Rewrite to make flow easier to understand.
2465 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2467 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2469 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2471 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2472 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2474 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2476 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2477 keyword warning to -Wc++0x-compat.
2479 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2481 * decl.c (grokdeclarator): Update documentation.
2483 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2486 * decl.c (grokdeclarator): If __thread is used together with
2487 a storage class other than extern and static, clear thread_p
2488 after issuing diagnostics and fall through to checking the
2491 2007-01-30 Roger Sayle <roger@eyesopen.com>
2493 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2494 calculating the size of an array (to avoid recursive errors).
2496 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2499 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2501 * call.c (convert_like_real): Don't warn when converting to
2504 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2506 * decl.c (pop_label): Replace warning with call to
2507 warn_for_unused_label.
2509 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2512 * semantics.c (finish_pseudo_destructor_expr): Check the
2513 destrutor name by calling check_dtor_name.
2515 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2517 * lex.c (D_CPP0X): Rename.
2519 (reswords): D_CPP0X -> D_CXX0X.
2520 (init_reswords): Ditto.
2521 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2522 of C++0x keywords as identifiers.
2524 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2527 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2530 2007-01-23 Ian Lance Taylor <iant@google.com>
2532 * typeck.c (convert_for_assignment): Only warn about a = b = c
2533 when converting to bool.
2535 2007-01-23 Roger Sayle <roger@eyesopen.com>
2537 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2539 * typeck.c (ignore_overflows): Remove the remaining uses of
2540 TREE_CONSTANT_OVERFLOW.
2542 2007-01-20 Jan Hubicka <jh@suse.cz>
2544 * decl2.c (start_objects, start_static_storage_duration_function):
2545 Do not make the functions uninlinable.
2547 2007-01-17 Ian Lance Taylor <iant@google.com>
2549 * class.c (add_method): Call VEC_reserve_exact rather than passing
2550 a negative size to VEC_reserve.
2552 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2555 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2557 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2560 * decl.c (make_typename_type): If the qualified name is not a
2561 type, issue an error.
2562 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2565 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2567 * rtti.c: Include target.h.
2568 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2569 don't emit typeinfo for fundamental types as weak.
2570 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2572 2007-01-08 Richard Guenther <rguenther@suse.de>
2574 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2576 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2578 * call.c (standard_conversion): Pass flag to
2579 vector_types_convertible_p to disallow emission of note.
2580 * typeck.c (convert_for_assignment): Pass flag to
2581 vector_types_convertible_p to allow emission of note.
2582 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2583 to disallow emission of note.
2585 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2588 * typeck.c (build_binary_op): Call overflow_warning if
2589 TREE_OVERFLOW_P is true for the result and not for any of the
2592 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2595 * class.c (add_method): Don't wait until template
2596 instantiation time to complain about duplicate methods.
2598 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2601 * semantics.c (finish_unary_op_expr): Warn only if result
2602 overflowed and operands did not.
2604 2007-01-05 Ian Lance Taylor <iant@google.com>
2606 * typeck.c (build_binary_op): Warn about comparing a non-weak
2609 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2611 * pt.c (tsubst): Propagate the need for structural equality checks
2612 when reducing the level of template parameters.
2614 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2616 * pt.c: Fix a comment typo.
2618 2007-01-02 Ian Lance Taylor <iant@google.com>
2620 * semantics.c (maybe_convert_cond): Optionally warn when using an
2621 assignment as a condition.
2622 * typeck.c (convert_for_assignment): Optionally warn about
2623 assigning the result of an assignment to a bool.
2625 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2627 * pt.c (canonical_template_parms): Correct typo in comment.
2629 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2631 * typeck.c (structural_comptypes): Renamed from "comptypes".
2632 (comptypes): Use canonical type information to perform fast type
2633 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2634 canonical type comparison returns the same results as we would see
2635 from the current, structural check. Support COMPARE_STRUCTURAL
2636 when we need structural checks.
2637 * decl.c (typename_compare): Fix comment.
2638 (build_typename_type): TYPENAME_TYPE nodes require structural
2639 equality checks, because they resolve different based on the
2641 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2642 require structural equality checks (for now).
2643 (build_ptrmemfunc_type): Build the canonical pointer to member
2645 (compute_array_index_type): Whenever we build a new index type
2646 to represent the size of an array in a template, we need to mark
2647 this index type as requiring structural equality. This goes for
2648 arrays with value-dependent sizes with the current ABI, or all
2650 * tree.c (cplus_array_hash): New.
2651 (struct cplus_array_info): New.
2652 (cplus_array_compare): New.
2653 (cplus_array_htab): New.
2654 (build_cplus_array_type_1): Use a hash table to cache the array
2655 types we build. Build the canonical array type for each array
2657 (cp_build_qualified_type_real): When building a cv-qualified array
2658 type, use the hash table of array types and build canonical array
2660 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2661 use structural equality (for now).
2662 * cp-tree.h (COMPARE_STRUCTURAL): New.
2663 * pt.c (canonical_template_parms): New.
2664 (canonical_type_parameter): New.
2665 (process_template_parm): Find the canonical type parameter.
2666 (lookup_template_class): When we have named the primary template
2667 type, set the canonical type for our template class to the primary
2668 template type. If any of the template arguments need structural
2669 equality checks, the template class needs structural equality
2671 (tsubst): When reducing the level of a template template
2672 parameter, we require structural equality tests for the resulting
2673 parameter because its template parameters have not had their types
2674 canonicalized. When reducing a template type parameter, find the
2675 canonical reduced type parameter.
2676 (any_template_arguments_need_structural_equality_p): New.