1 2007-09-18 Paolo Carlini <pcarlini@suse.de>
4 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
5 (pp_cxx_primary_expression): Use it.
6 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
7 * error.c (dump_expr): Use it.
9 2007-09-16 Paolo Carlini <pcarlini@suse.de>
12 * init.c (build_new): Remove warning for zero-element
15 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
19 * call.c (maybe_handle_implicit_object): Set this_p, clear
20 rvaluedness_matches_p.
21 (compare_ics): Do not compare rvaluedness matching when one of the
22 operands is an implicit object.
26 * g++.dg/overload/operator3.C: New.
28 2007-09-14 Jason Merrill <jason@redhat.com>
30 PR c++/17743, c++/19163
31 * decl2.c (is_late_template_attribute): New fn.
32 (splice_template_attributes, save_template_attributes): New fns.
33 (cplus_decl_attributes): Call save_template_attributes.
34 * pt.c (apply_late_template_attributes): New fn.
35 (instantiate_class_template, tsubst_decl): Use it.
36 * cp-tree.h: Declare is_late_template_attribute.
38 2007-09-13 Tom Tromey <tromey@redhat.com>
40 * parser.c (cp_lexer_new_main): Don't use
41 c_lex_return_raw_strings.
42 (cp_lexer_get_preprocessor_token): Update. Add special case when
45 2007-09-11 Jan Hubicka <jh@suse.cz>
47 * method.c (use_thunk): Use tree_rest_of_compilation
48 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
49 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
50 * cp-tree.h (expand_body): Kill.
51 (emit_associated_thunks): Declare.
52 * semantics.c (emit_associated_thunks): Export.
55 2007-09-09 David Daney <ddaney@avtrex.com>
58 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
59 to calculate cookie_ptr.
61 2007-09-08 Jason Merrill <jason@redhat.com>
64 * pt.c (most_specialized_class): Set processing_template_decl
65 while tsubsting partial spec args.
67 2007-09-06 Jason Merrill <jason@redhat.com>
69 * decl2.c (get_guard): Copy visibility from the guarded variable.
71 2007-09-06 Jan Hubicka <jh@suse.cz>
73 * semantics.c (expand_body): Do not mark arguments of clones used.
75 2007-09-06 Paolo Carlini <pcarlini@suse.de>
78 * decl.c (cp_finish_decl): When processing_template_decl,
79 deal correctly with init as TREE_LIST.
81 2007-09-06 Tom Tromey <tromey@redhat.com>
83 * decl.c (finish_function): Put return's location on line zero of
86 2007-09-05 Jason Merrill <jason@redhat.com>
89 * except.c (prepare_eh_type): Use type_decays_to.
92 * init.c (build_delete): Use build_headof to get the address of the
93 complete object if we aren't using the deleting destructor.
94 * rtti.c (build_headof): No longer static.
95 * cp-tree.h: Declare it.
97 2007-09-06 Jakub Jelinek <jakub@redhat.com>
99 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
100 decl if a prototype for XX is provided with throw().
103 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
104 on __*_chk non-__builtin_* decls.
106 2007-09-05 Paolo Carlini <pcarlini@suse.de>
109 * semantics.c (finish_id_expression): Use context_for_name_lookup
110 insted of DECL_CONTEXT, to see through anonymous structs and unions.
111 * class.c (finish_struct_anon): Deal correctly with anonymous
112 structs (vs unions, as GNU extension) in error messages.
114 2007-09-05 Jan Hubicka <jh@suse.cz>
116 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
117 call, DECL_EXTERNAL checks and current_function_decl saving.
119 2007-09-05 Paolo Carlini <pcarlini@suse.de>
122 * parser.c (cp_parser_primary_expression): Return error_mark_node
123 when a statement-expression is found in a template-argument list.
125 2007-09-04 Jason Merrill <jason@redhat.com>
127 * except.c (initialize_handler_parm): Use
128 fold_build_cleanup_point_expr.
131 * call.c (reference_binding): Don't look for user-defined conversions
135 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
136 the MUST_NOT_THROW_EXPR.
138 2007-09-04 Richard Sandiford <richard@codesourcery.com>
140 * decl.c (cp_finish_decl): Call determine_visibility before
141 make_rtl_for_nonlocal_decl.
143 2007-09-04 Jason Merrill <jason@redhat.com>
146 * pt.c (most_specialized_class): Substitute outer template
147 arguments into the arguments of a member template partial
149 (strip_innermost_template_args): New fn.
151 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
153 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
155 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
157 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
158 * decl.c (cp_make_fname_decl): Likewise,
159 * parser.c (cp_parser_string_literal): Likewise,
160 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
161 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
164 2007-09-02 Paolo Carlini <pcarlini@suse.de>
167 * typeck.c (build_unary_op): Fix error message for
168 Boolean expression as operand to operator--.
170 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
172 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
173 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
176 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
179 * init.c (build_default_init): Make extern.
180 * cp-tree.h (build_default_init): Declare here.
181 * pt.c (tsubst_expr): When the instantiation of the initializer of
182 a variable results in an empty list, default-initialize the
184 (tsubst_copy_and_build): When the instantiation of the initializer
185 in a new expression results in an empty initializer list,
186 default-initialize it.
188 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
190 * mangle.c (write_type): Change mangling of rvalue reference from
193 2007-08-31 Jakub Jelinek <jakub@redhat.com>
195 * decl.c (duplicate_decls): Remove duplicated line.
197 2007-08-31 Paolo Carlini <pcarlini@suse.de>
200 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
201 BOUND_TEMPLATE_TEMPLATE_PARM.
203 2007-08-31 Paolo Carlini <pcarlini@suse.de>
206 * search.c (lookup_member): Check the name argument for
209 2007-08-31 Paolo Carlini <pcarlini@suse.de>
212 * parser.c (cp_parser_trait_expr): Check rerurn value of
215 2007-08-30 Ollie Wild <aaw@google.com>
217 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
218 convert_ptrmem for pointer to member conversions.
219 (convert_to_pointer_force): Update cp_convert_to_pointer call.
220 (ocp_convert): Update cp_convert_to_pointer call.
221 * typeck.c (convert_ptrmem): Add conditional for null pointers to
223 (build_static_cast_1): Check can_convert for conversions in either
225 (get_delta_difference_1): New function.
226 (get_delta_difference): Refactor to call get_delta_difference_1.
228 2007-08-30 Jakub Jelinek <jakub@redhat.com>
230 * decl.c (start_preparsed_function): Set
231 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
233 2007-08-28 Paolo Carlini <pcarlini@suse.de>
236 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
237 BOUND_TEMPLATE_TEMPLATE_PARM.
239 2007-08-28 Jakub Jelinek <jakub@redhat.com>
243 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
244 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
246 2007-08-27 Jason Merrill <jason@redhat.com>
249 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
250 Look inside STMT_EXPR.
251 * semantics.c (stmt_expr_value_expr): New fn.
252 * cp-tree.h: Declare it.
255 * decl.c (groktypename): Ignore attributes applied to class type.
257 2007-08-28 Richard Guenther <rguenther@suse.de>
259 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
261 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
263 * error.c (dump_expr): Handle COMPLEX_CST.
264 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
265 (pp_cxx_expression): Likewise.
267 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
269 * decl.c (GNU_INLINE_P): New.
270 (duplicate_decls): Handle gnu_inline. Merge attributes and
271 some flags in overriding definitions.
272 (redeclaration_error_message): Handle gnu_inline.
273 (start_preparsed_function): Likewise.
275 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
277 * call.c (sufficient_parms_p): Constify.
278 * class.c (same_signature_p): Likewise.
279 * cp-gimplify.c (is_invisiref_parm,
280 cxx_omp_privatize_by_reference): Likewise.
281 * cp-objcp-common.c (has_c_linkage): Likewise.
282 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
283 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
284 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
285 num_artificial_parms_for, comp_template_parms,
286 template_parameter_pack_p, any_dependent_template_arguments_p,
287 any_type_dependent_arguments_p, any_value_dependent_elements_p,
288 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
289 zero_init_p, member_p, cp_lvalue_kind,
290 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
291 varargs_function_p, is_dummy_object, special_function_kind,
292 string_conv_p, type_unknown_p, comp_except_specs, compparms,
293 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
294 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
295 cp_has_mutable_p, at_least_as_qualified_p,
296 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
297 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
298 * except.c (nothrow_libfn_p): Likewise.
299 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
301 * pt.c (comp_template_parms, template_parameter_pack_p,
302 any_type_dependent_arguments_p, any_value_dependent_elements_p,
303 any_dependent_template_arguments_p): Likewise.
304 * repo.c (repo_export_class_p): Likewise.
305 * semantics.c (anon_aggr_type_p): Likewise.
306 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
307 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
308 varargs_function_p, member_p, is_dummy_object, pod_type_p,
309 zero_init_p, special_function_p): Likewise.
310 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
311 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
312 compparms, invalid_nonstatic_memfn_p,
313 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
314 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
315 cp_has_mutable_p, lvalue_or_else): Likewise.
317 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
319 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
320 * cp-objcp-common.c (cp_tree_size): Ditto.
321 * tree.c (cp_walk_subtrees): Ditto
322 * cp-tree.def (TINST_LEVEL): Go away.
323 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
324 move together with other non-tree structs.
325 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
326 (union lang_tree_node): Eliminate tinst_level field.
327 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
328 (current_instantiation, outermost_tinst_level): Return
329 a "struct tinst_level *".
331 * error.c (print_instantiation_partial_context): Change second
332 parameter to a "struct tinst_level *". Replace accessor macros
334 (print_instantiation_full_context): Likewise.
335 * lex.c (in_main_input_context): Likewise.
337 * pt.c (struct pending_templates): New.
338 (pending_templates, last_pending_template): Use it as a type.
339 (current_tinst_level): Change typo to "struct tinst_level *"
340 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
341 (add_pending_template): Construct a "struct pending_template".
342 Replace TINST_LEVEL accessor macros with field access.
343 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
344 (pop_tinst_level): Likewise.
345 (instantiate_pending_templates): Likewise. Factor common code used
346 when an instantiation has been done.
347 (outermost_tinst_level): Replace tree_last with loop.
348 (current_instantiation): Return a "struct tinst_level *".
350 2007-08-24 Ollie Wild <aaw@google.com>
352 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
353 * name-lookup.h (cp_binding_level): Remove vtables member.
355 2007-08-24 Richard Guenther <rguenther@suse.de>
357 * tree.c (cp_cannot_inline_tree_fn): Remove.
358 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
359 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
362 2007-08-24 Jakub Jelinek <jakub@redhat.com>
365 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
366 error_mark_node right away if build_expr_type_conversion
370 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
371 is error_mark_node rather than NULL_TREE.
372 * pt.c (check_explicit_specialization): Likewise.
375 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
376 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
378 2007-08-22 Jason Merrill <jason@redhat.com>
381 * pt.c (outermost_tinst_level): New function.
382 * lex.c (in_main_input_context): New function.
383 * cp-tree.h: Declare it.
384 * decl2.c (constrain_class_visibility): Use it to avoid warning
385 about uses of the anonymous namespace in the main input file.
387 2007-08-21 Jakub Jelinek <jakub@redhat.com>
389 * init.c (build_new_1): Use get_target_expr instead of save_expr.
391 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
394 * class.c (finish_struct_1): Warn when a class has virtual
395 functions and accessible non-virtual destructor.
397 2007-08-20 Richard Guenther <rguenther@suse.de>
401 * call.c (build_new_method_call): Convert initializer to
403 * init.c (build_aggr_init): Do not fiddle with types.
404 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
405 * except.c (build_throw): Do not drop qualifiers for the
407 * typeck.c (get_member_function_from_ptrfunc): Do not
408 fiddle with types, instead convert.
409 (build_ptrmemfunc1): Convert to the target type for
411 (gfc_trans_allocate): Convert result to target type.
412 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
413 pointer-to-member structures shall have alias set zero as well.
415 2007-08-20 Richard Guenther <rguenther@suse.de>
417 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
419 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
420 (nonstatic_local_decl_p): Likewise.
421 * tree.c (cp_auto_var_in_fn_p): Remove.
422 * decl.c (nonstatic_local_decl_p): Remove.
424 2007-08-20 Richard Guenther <rguenther@suse.de>
426 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
428 * tree.h (cp_walk_tree): New define to walk_tree_1 with
429 cp_walk_subtrees lh parameter.
430 (cp_walk_tree_without_duplicates): New define to
431 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
432 * tree.c (count_trees): Call
433 cp_walk_tree_without_duplicates.
434 (verify_stmt_tree): Call cp_walk_tree.
435 (break_out_target_exprs): Likewise.
436 (WALK_SUBTREE): Likewise.
437 * cp-gimplify.c (cp_genericize): Likewise.
438 * cp-pt.c (find_parameter_packs_r): Likewise.
439 (uses_parameter_packs): Likewise.
440 (make_pack_expansion): Likewise.
441 (check_for_bare_parameter_packs): Likewise.
442 (for_each_template_parm): Likewise.
443 * decl.c (check_default_argument): Call
444 cp_walk_tree_without_duplicates.
445 * except.c (build_throw): Likewise.
446 * decl2.c (type_visibility): Likewise.
447 * semantics.c (expand_or_defer_fn): Likewise.
448 (finalize_nrv): Call cp_walk_tree.
450 2007-08-20 Jakub Jelinek <jakub@redhat.com>
453 * init.c (build_new_1): Rename placement_var variable to placement_expr.
454 Initialize it with save_expr rather than get_temp_regvar.
456 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
459 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
462 2007-08-17 Ollie Wild <aaw@google.com>
465 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
466 declarations into appropriate slots for comparison. Fix type
469 2007-08-17 Paolo Carlini <pcarlini@suse.de>
472 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
473 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
475 2007-08-17 Paolo Carlini <pcarlini@suse.de>
478 * parser.c (cp_parser_class_head): Improve error message.
480 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
482 * pt.c (instantiate_decl): Set input_location
483 for the function end.
485 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
487 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
489 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
490 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
491 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
492 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
493 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
494 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
495 * typeck.c (cp_type_quals): Likewise.
496 * typeck2.c (cxx_incomplete_type_diagnostic,
497 cxx_incomplete_type_error): Likewise.
499 2007-08-16 Paolo Carlini <pcarlini@suse.de>
502 * pt.c (tsubst_friend_function): When check_classfn
503 returns error_mark_node likewise return it.
505 2007-08-15 Jakub Jelinek <jakub@redhat.com>
508 * typeck.c (check_return_expr): Don't NRV optimize vars in
510 * decl.c (finish_function): Comment fix.
512 2007-08-15 Paolo Carlini <pcarlini@suse.de>
515 * pt.c (push_template_decl_real): Depending on TYPE_P
516 use either TYPE_CONTEXT or DECL_CONTEXT.
518 2007-08-14 Mark Mitchell <mark@codesourcery.com>
520 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
521 constructors and destructors return this.
523 2007-08-14 Paolo Carlini <pcarlini@suse.de>
526 * decl2.c (check_classfn): Return error_mark_node in case of error;
527 in that case, do not call add_method.
528 * decl.c (start_decl): Deal with check_classfn returning
530 (grokfndecl): Likewise.
531 * pt.c (tsubst_friend_function): Likewise.
533 2007-08-14 Andrew Pinski <pinskia@gmail.com>
536 * typeck.c (build_binary_op): Disallow vector float types with
537 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
539 2007-08-11 Ian Lance Taylor <iant@google.com>
541 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
543 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
545 2007-08-10 Ollie Wild <aaw@google.com>
547 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
549 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
551 (unqualified_namespace_lookup): Fix ambiguous_decl call.
552 (lookup_using_namespace): Fix ambiguous_decl call.
553 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
555 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
557 * call.c (name_as_c_string): Use CONST_CAST.
558 * decl.c (build_decl): Likewise.
559 * parser.c (cp_parser_string_literal): Likewise.
561 2007-08-10 Paolo Carlini <pcarlini@suse.de>
564 * error.c (dump_expr): Consistently use the *_cxx_*
565 variants of the pretty-print functions.
567 2007-08-10 Paolo Carlini <pcarlini@suse.de>
570 * decl.c (check_special_function_return_type): Just error
571 on return type specified for conversion operator.
573 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
575 * typeck2.c (readonly_error): Handle general expressions.
576 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
578 2007-08-06 Dan Hipschman <dsh@google.com>
580 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
581 access function name.
583 2007-08-04 Alfred Minarik <a.minarik@aon.at>
586 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
587 * g++spec.c (lang_specific_driver): Check them.
589 2007-08-06 Paolo Carlini <pcarlini@suse.de>
592 * pt.c (inline_needs_template_parms): Fix comment; change return type
595 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
598 2007-03-26 Dirk Mueller <dmueller@suse.de>
600 * parser.c (cp_parser_member_declaration): Pedwarn
601 about stray semicolons after member declarations.
603 2007-08-02 Lee Millward <lee.millward@gmail.com>
608 * parser.c (cp_parser_asm_definition): Detect and discard asm
609 statements with invalid inputs or outputs.
610 (cp_parser_asm_operand_list): Return error mark node if any
611 of the operands are invalid. Adjust documentation.
613 2007-08-02 Nick Clifton <nickc@redhat.com>
615 * typeck.c: Change copyright header to refer to version 3 of the
616 GNU General Public License and to point readers at the COPYING3
617 file and the FSF's license web page.
618 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
619 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
620 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
621 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
622 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
623 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
624 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
625 name-lookup.h, parser.c: Likewise.
627 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
630 * call.c (magic_varargs_p): Honor the "type generic" attribute.
632 2007-07-30 Paolo Carlini <pcarlini@suse.de>
635 * semantics.c (finish_label_stmt): Reject the __label__
636 extension outside function scopes.
638 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
640 * parser.c (eof_token): Un-constify.
641 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
642 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
645 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
647 * pt.c, tree.c, typeck2.c: Fix comment typos.
649 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
650 Mark Mitchell <mark@codesourcery.com>
653 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
654 hidden due to friend declarations in local classes.
656 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
658 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
659 * cp-tree.def (DECLTYPE_TYPE): New.
660 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
661 (dump_type_prefix): Ditto.
662 (dump_type_suffix): Ditto.
663 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
664 * mangle.c (write_type): Handle DECLTYPE_TYPE.
665 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
667 (DECLTYPE_TYPE_EXPR): New.
668 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
669 (finish_declared_type): Declare.
670 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
672 (pp_cxx_type_id): Ditto.
673 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
674 (tsubst): Substitute into a DECLTYPE_TYPE node.
675 (tsubst_copy): Ditto.
676 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
678 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
679 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
680 structural equality (because we can't hash the expressions).
681 (finish_declared_type): New.
682 * lex.c (reswords): Add "decltype" keyword.
683 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
684 (cp_parser_postfix_expression): Add member_access_only_p to
685 restrict postfix expression to member access expressions.
686 (cp_parser_unary_expression): Update call to
687 cp_parser_postfix_expression to reflect new parameter.
688 (cp_parser_declared_type): New.
689 (cp_parser_simple_type_specifier): Parse decltype types.
691 2007-07-27 Mark Mitchell <mark@codesourcery.com>
694 * call.c (convert_for_arg_passing): Only widen bitfields to their
695 declared types if necessary.
697 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
699 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
702 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
704 * decl.c (typename_hash, typename_compare): Constify.
705 * mangle.c (hash_type, compare_type): Likewise.
706 * pt.c (eq_local_specializations, hash_local_specialization):
708 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
709 list_hash): Likewise.
710 * typeck2.c (pat_compare): Likewise.
712 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
714 * method.c (implicitly_declare_fn): Increase alignment if member
715 function pointer format requires it.
717 2007-07-24 Paolo Carlini <pcarlini@suse.de>
720 * typeck.c (check_return_expr): Do not pass a null argument
723 2007-07-24 Paolo Carlini <pcarlini@suse.de>
726 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
729 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
732 * typeck.c (convert_arguments): Only use default args if we have
736 * typeck.c (structural_comptypes): No need to check
737 resolve_typename_type return value here.
738 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
739 * pt.c (resolve_typename_type): Follow typename typedefs. Return
740 original type rather than error_mark_node in case of failure.
741 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
742 resolve_typename_type result check.
743 (cp_parser_direct_declarator, cp_parser_head,
744 cp_parser_constructor_declarator_p): Likewise.
746 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
748 * pt.c (template_parms_variadic_p): Remove.
749 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
751 2007-07-12 Jakub Jelinek <jakub@redhat.com>
754 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
755 argument to dump_aggr_init_expr_args instead of false.
757 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
759 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
760 canonical types; otherwise, fall back to structural type
761 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
762 internal compiler error if the canonical types are wrong.
764 2007-07-11 Paolo Carlini <pcarlini@suse.de>
767 * parser.c (cp_parser_make_indirect_declarator): When the
768 the code argument is ERROR_MARK return cp_error_declarator.
770 2007-07-09 Geoffrey Keating <geoffk@apple.com>
773 * decl.c (cxx_init_decl_processing): Don't set
774 force_align_functions_log.
775 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
776 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
777 FUNCTION_DECL, return its alignment.
779 2007-07-09 Richard Guenther <rguenther@suse.de>
781 * decl.c (start_preparsed_function): Do not promote return type.
783 2007-07-08 Paolo Carlini <pcarlini@suse.de>
786 * pt.c (unify): Never pass error_mark_node to template_decl_level.
788 2007-07-07 Mark Mitchell <mark@codesourcery.com>
791 * pt.c (resolve_overloaded_unification): Robustify. Return a
793 (type_unification_real): Adjust accordingly.
795 2007-07-06 Richard Guenther <rguenther@suse.de>
797 * init.c (build_new_1): Use the correct pointer type.
798 * typeck2.c (build_m_component_ref): Likewise.
800 2007-07-05 Mark Mitchell <mark@codesourcery.com>
803 * init.c (build_zero_init): Always build an initializer for
805 * typeck2.c (build_functional_cast): Use build_zero_init.
808 * init.c (build_new_1): Always pass the allocation function to
809 build_op_delete_call.
810 * call.c (build_op_delete_call): Handle operator delete with a
811 variable-argument list. Do not issue an error when no matching
812 deallocation function is available for a new operator.
815 * cp-tree.h (any_value_dependent_elements_p): Declare it.
816 * decl.c (value_dependent_init_p): New function.
817 (cp_finish_decl): Use it.
818 * pt.c (value_dependent_expression_p): Use
819 any_value_dependent_elements_p.
820 * parser.c (cp_parser_primary_expression): Add comment about
821 treating dependent qualified names as integral
822 constant-expressions.
824 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
826 * decl.c (build_ptrmemfunc_type): Always use structural equality
827 tests when comparing pointer-to-member-function types, because the
828 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
831 2007-07-03 Mark Mitchell <mark@codesourcery.com>
833 * init.c (build_new): Tweak comment.
835 2007-06-29 Dave Brolley <brolley@redhat.com>
838 * parser.c (cp_parser_new_type_id): Don't reduce a named array
839 type to its base type and number of elements here.
840 * init.c (build_new): Call complete_type_or_else to ensure that the
841 type is complete and to issue a diagnostic if it is not.
842 (build_new_1): Don't call complete_type_or_else here.
844 2007-07-03 Richard Guenther <rguenther@suse.de>
847 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
850 2007-07-02 Simon Baldwin <simonb@google.com>
852 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
853 for inner-style nested forward declarations that don't declare
856 2007-07-02 Jakub Jelinek <jakub@redhat.com>
859 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
860 DECL_P in not a variable and appears more than once error messages.
862 2007-07-01 Ollie Wild <aaw@google.com>
864 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
865 (select_decl): Remove function.
866 (unqualified_namespace_lookup): Populate binding by calling
867 ambiguous_decl. Remove select_decl call.
868 (lookup_qualified_name): Remove select_decl call.
869 * decl.c (lookup_and_check_tag): Check for ambiguous references.
870 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
871 generation when name lookup is ambiguous.
873 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
876 * init.c (build_new_1): Use structural equality on the copy of the
879 2007-06-28 Geoffrey Keating <geoffk@apple.com>
881 * decl2.c (determine_visibility): Implement
882 flag_visibility_ms_compat effect on type info.
883 * decl.c (cxx_init_decl_processing): Implement
884 global effect of flag_visibility_ms_compat.
886 2007-06-28 Geoffrey Keating <geoffk@apple.com>
888 * decl2.c (start_objects): Mark constructor-running function
891 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
894 * decl.c (grokdeclarator): Reset friendp for member functions declared
895 friend of their own class.
897 2007-06-23 Mark Mitchell <mark@codesourcery.com>
899 * decl2.c (determine_visibility): Don't look for dllexport here.
900 (determine_visibility_from_class): Tidy.
902 2007-06-18 Simon Baldwin <simonb@google.com>
905 * parser.c (cp_parser_single_declaration): Added check for storage
906 class other than sc_none in parsed declaration, and a flag to indicate
907 if the call is part of an explicit template specialization parse.
908 * (cp_parser_explicit_specialization): Specialization check flag added
909 to call to cp_parser_single_declaration(), set true.
910 * (cp_parser_template_declaration_after_export): Specialization check
911 flag added to call to cp_parser_single_declaration(), set false.
912 * pt.c (check_explicit_specialization): Added code to copy visiblity
913 and linkage from the templated function to the explicit specialization.
915 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
917 * typeck.c (build_binary_op): For templates build the
918 expression in pieces to avoid the assert in build2_stat.
919 (get_member_function_from_ptrfunc):
920 Change over to using POINTER_PLUS_EXPR and convert
921 the second operand to sizetype.
922 * typeck2.c (build_m_component_ref): Likewise.
923 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
924 instead of PLUS_EXPR for pointers.
925 (build_new_1): Likewise.
926 (build_vec_delete_1): Likewise.
927 (build_vec_delete): Likewise.
928 * class.c (build_base_path): Likewise.
929 (build_base_path): Likewise.
930 (convert_to_base_statically): Likewise.
931 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
932 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
933 instead of PLUS_EXPR.
934 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
935 instead of PLUS_EXPR for pointers.
936 * call.c (build_special_member_call): Likewise.
937 * rtti.c (build_headof): Likewise.
938 Use sizetype instead of ptrdiff_type_node.
939 (tinfo_base_init): Create a POINTER_PLUS_EXPR
940 instead of PLUS_EXPR for pointers.
941 * except.c (expand_start_catch_block): Do a
942 NEGATIVE and then a POINTER_PLUS_EXPR instead
944 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
945 PLUS_EXPR on pointer types over to use
946 POINTER_PLUS_EXPR and remove the conversion
947 to the pointer types.
948 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
949 adding to a pointer type. Use size_int instead of
950 ssize_int. Convert the index to sizetype before
951 adding it to the pointer.
953 2007-06-15 Mark Mitchell <mark@codesourcery.com>
955 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
956 (DECL_ANON_UNION_VAR_P): New macro.
957 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
958 than DECL_VAR_MARKED_P, to keep track of which variables we have
960 * decl.c (redeclaration_error_message): Complain about redeclaring
961 anonymous union members at namespace scope.
962 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
964 2007-06-14 Geoff Keating <geoffk@apple.com>
966 * decl2.c (determine_visibility): Ensure that functions with
967 hidden types as parameters are hidden.
970 * decl2.c (determine_visibility): Remove duplicate code for
973 2007-06-12 Ian Lance Taylor <iant@google.com>
976 * init.c (avoid_placement_new_aliasing): New static function.
977 (build_new_1): Call it.
979 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
981 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
982 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
984 2007-06-08 Jakub Jelinek <jakub@redhat.com>
987 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
988 on init, the non-decl cond operand and increment value.
990 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
993 * decl.c (check_initializer): Report an error when a brace enclosed
994 initializer is used for a non-aggregate type in C++98.
995 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
997 (grokdeclarator): Likewise.
998 (move_fn_p): Likewise.
999 * typeck.c (check_return_expr): Likewise.
1000 * call.c (reference_binding): Likewise.
1001 * error.c (cp_cpp_error): Likewise.
1002 * pt.c (check_default_tmpl_args): Likewise.
1004 * lex.c (init_reswords): Likewise.
1005 * parser.c (p_parser_primary_expression): Likewise.
1006 (TOKEN_PRECEDENCE): Likewise.
1007 (cp_parser_init_declarator): Likewise.
1008 (cp_parser_ptr_operator): Likewise.
1009 (cp_parser_parameter_declaration): Likewise.
1010 (cp_parser_enclosed_template_argument_list): Likewise.
1011 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1012 (cp_parser_next_token_ends_template_argument_p): Likewise.
1014 2007-06-04 Simon Baldwin <simonb@google.com>
1016 * decl.c (grokdeclarator): Readability change. Moved case labels
1017 into direct switch statement scope.
1019 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1021 * call.c (convert_like_real): Remove pointless code.
1023 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1025 * decl.c (get_atexit_fn_ptr_type): New function.
1026 (get_atexit_node): Use it.
1027 (start_cleanup_fn): Likewise.
1028 (register_dtor_fn): Use the object's destructor, instead of a
1029 separate cleanup function, where possible.
1030 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1031 (atexit_fn_ptr_type_node): New macro.
1032 * decl2.c (build_cleanup): Use build_address.
1034 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1036 * typeck.c (build_binary_op): Include types in error.
1038 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1041 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1042 needs runtime initialization.
1044 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1047 * semantics.c (finish_trait_expr): Complete the types.
1049 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1050 Douglas Gregor <doug.gregor@gmail.com>
1051 Pedro Lamarao <pedro.lamarao@mndfck.org>
1052 Howard Hinnant <howard.hinnant@gmail.com>
1056 * typeck.c (comptypes): Don't consider rvalue and lvalue
1057 reference types to be equivalent.
1058 (check_return_expr): Move from certain lvalues when returning
1060 * decl.c (grokdeclarator): Implement reference collapsing.
1061 (copy_fn_p): Don't consider constructors taking rvalue references
1062 to be copy constructors.
1064 * call.c (conversion): New "rvaluedness_matches_p" member.
1065 (convert_class_to_reference): Require reference type as first
1066 parameter instead of base type.
1067 (reference_binding): Add logic to handle rvalue references.
1068 (implicit_conversion): Update inaccurate comment.
1069 (convert_like_real): Disable creation of temporaries that are
1070 impossible to initialize for types with move constructors.
1071 (build_over_call): Elide move constructors when possible.
1072 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1073 (maybe_handle_ref_bind): Return conversion instead of type node.
1074 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1075 determine preferred conversion sequences.
1076 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1077 (LOOKUP_PREFER_RVALUE): New.
1078 (DECL_MOVE_CONSTRUCTOR_P): New.
1079 (struct cp_declarator): Add "reference" member for reference
1080 types, with new "rvalue_ref" flag.
1081 (cp_build_reference_type): Declare.
1082 (move_fn_p): Declare.
1083 * error.c (dump_type_prefix): Format rvalue reference types
1084 correctly in error messages.
1085 * except.c (build_throw): Move from certain lvalues when
1087 * mangle.c (write_type): Mangle rvalue references differently
1088 than regular references.
1089 * parser.c (make_reference_declarator): Add boolean parameter for
1091 (cp_parser_make_indirect_declarator): New.
1092 (cp_parser_new_declarator_opt): Call
1093 cp_parser_make_indirect_declarator.
1094 (cp_parser_conversion_declarator_opt): Ditto.
1095 (cp_parser_declarator): Ditto.
1096 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1098 * pt.c (tsubst): Implement reference collapsing.
1099 (maybe_adjust_types_for_deduction): Implement special template
1100 parameter deduction rule for rvalue references.
1101 (type_unification_real): Update calls to
1102 maybe_adjust_types_for_deduction.
1103 (try_one_overload): Ditto.
1104 (unify_pack_expansion): Ditto.
1105 * tree.c (lvalue_p_1): Handle rvalue reference types.
1106 (cp_build_reference_type): New.
1108 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1111 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1112 variables that need runtime initialization.
1114 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1117 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1118 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1119 case POSTDECREMENT_EXPR>): Return the error_mark_node
1120 if either the real or imaginary parts would an
1123 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1124 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1127 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1128 token is a closing brace, false if there are no tokens left.
1129 (cp_parser_namespace_alias_definition): Only consume the next token if
1130 it is a closing brace.
1132 * parser.c (cp_parser_class_specifier): Likewise.
1134 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1136 * semantics.c (finish_member_declaration): Fix a typo in the
1139 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1151 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1152 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1153 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1154 whether everything was okay. Fix indentation.
1155 (push_template_decl_real): Check for bare parameter packs in
1156 function parameters; where errors occur, mark the parameter types
1157 with ERROR_MARK_NODEs to avert ICEs.
1158 (coerce_template_parameter_pack): New.
1159 (coerce_template_parms): Moved parameter pack coercion into
1160 coerce_template_parameter_pack, and permit it anywhere in the
1161 template parameter list (not just at the end). Parameter and
1162 argument indices can vary (somewhat) separately now, so add
1163 PARM_IDX and ARG_IDX.
1164 (fn_type_unification): Don't set an argument pack as incomplete if
1165 no argument pack was deduced.
1166 (type_unification_real): If a type parameter is a parameter pack
1167 and has not otherwise been deduced, it will be deduced to an empty
1169 (more_specialized_fn): Use the actual lengths of the argument
1170 lists when comparing against expansions.
1171 * semantics.c (finish_member_declaration): If a field's type has
1172 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1174 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1177 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1179 2007-05-22 Ollie Wild <aaw@google.com>
1181 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1182 (unqualified_namespace_lookup): Adds check for hidden types.
1184 2007-05-22 Ollie Wild <aaw@google.com>
1186 * decl.c (duplicate_decls): Verify namespace names are unique.
1188 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1190 * decl.c (cxx_maybe_build_cleanup): Handle
1191 __attribute__((cleanup)).
1193 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1195 * cvt.c (cp_convert_and_check): Don't check warnings if the
1198 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1200 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1202 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1205 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1206 type only if is a class type (5.2.8/4).
1208 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1210 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1211 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1212 c_common_unsigned_type.
1214 2007-05-11 Silvius Rus <rus@google.com>
1216 * cp/typeck.c (build_indirect_ref): Add call to
1217 strict_aliasing_warning.
1218 (build_reinterpret_cast_1): Condition call to
1219 strict_aliasing_warning.
1221 2007-05-11 Jan Hubicka <jh@suse.cz>
1223 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1224 * decl2.c (start_objects): ctors and dtors are no longer public.
1225 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1227 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1229 * typeck.c (build_unary_op): Remove code that used to
1230 handle non lvalue increments/decrements.
1232 2007-05-07 Mike Stump <mrs@apple.com>
1234 * parser.c (check_empty_body): Add.
1235 (cp_parser_iteration_statement): Add call to check_empty_body.
1237 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1240 * mangle.c (write_mangled_name): Mangle static variable names.
1241 (write_unqualified_name): Use local-source-name for
1242 namespace-scope static variables.
1244 2007-05-04 Dirk Mueller <dmueller@suse.de>
1246 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1249 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1252 * decl2.c (constrain_class_visibility):
1253 Use strip_pointer_or_array_types instead of strip_array_types.
1255 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1258 * decl.c (reshape_init_r): Don't reshape the first element if it
1259 is a pointer to member function.
1261 2007-04-27 Simon Baldwin <simonb@google.com>
1263 * decl.c (grokparms): Changed message format from %qD to %qE.
1265 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1267 * error.c (maybe_warn_variadic_templates): Variadic templates are
1268 now in C++0x, so only warn about them in C++98 mode.
1270 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1273 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1274 integeral types from vectors types.
1276 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1279 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1280 for type dependent OMP_CLAUSE_DECLs.
1282 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1285 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1286 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1287 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1288 * init.c (build_zero_init): Adjust, as
1289 COMPLEX_TYPE is now a SCALAR_TYPE.
1290 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1291 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1293 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1295 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1296 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1297 (trait_expr_value): Adjust.
1299 2007-04-23 Simon Baldwin <simonb@google.com>
1301 * decl.c (grokparms): Added new error for duplicate function
1302 parameters names in function prototypes, to match gcc behavior.
1304 2007-04-23 Jan Hubicka <jh@suse.cz>
1306 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1309 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1311 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1312 instead of checking GIMPLE_STMT_P in chain_next.
1314 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1317 * call.c (convert_for_arg_passing): Convert bitfields to their
1320 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1323 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1325 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1328 * cp/decl2.c (constrain_class_visibility):
1329 Do not warn about the use of anonymous namespace in the main input file.
1331 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1333 * cp-tree.h (current_template_parms): Fix typo in comment.
1335 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1337 * cp-tree.h, error.c: Fix comment typos.
1339 2007-04-13 Jason Merrill <jason@redhat.com>
1342 * call.c (reference_binding): Add c_cast_p parm. If true,
1343 add quals to TO as needed to make it reference-compatible.
1345 2007-04-11 Jan Hubicka <jh@suse.cz>
1347 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1348 that we are not processing template_decl.
1350 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1353 * class.c (build_base_path): Ensure that the converted pointer has
1354 the same cv-qualification as the input.
1356 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1358 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1360 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1362 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1364 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1365 * tree.c (cp_add_pending_fn_decls): Remove.
1366 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1368 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1370 Revert change removing staticp.
1372 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1374 * cp-objcp-common.c (cxx_staticp): Remove.
1375 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1376 * cp-tree.h (cxx_staticp):
1378 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1380 * class.c (check_for_override): Don't remove dllmport attribute
1383 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1386 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1387 type issue error and return early.
1389 2007-03-30 Jason Merrill <jason@redhat.com>
1392 * typeck.c (cp_type_readonly): New fn.
1393 * cp-tree.h: Declare it.
1394 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1395 (cp_finish_decl): Not here.
1397 2007-03-31 Richard Guenther <rguenther@suse.de>
1399 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1402 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1407 * parser.c (declarator_can_be_parameter_pack): New.
1408 (cp_parser_template_parameter): Only parse the `...' if the
1409 declarator can be a parameter pack.
1410 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1412 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1413 types (they could be used as array bounds).
1414 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1415 (tsubst_pack_expansion): Handle failure to expand parameter
1418 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1421 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1422 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1423 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1424 (CLASS_TYPE_NON_UNION_P): Add.
1425 (struct lang_type_class): Add has_complex_dflt.
1426 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1427 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1428 * cp-tree.def: Add TRAIT_EXPR.
1429 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1430 * lex.c (struct resword): Add __has_nothrow_assign,
1431 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1432 __has_trivial_constructor, __has_trivial_copy,
1433 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1434 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1435 __is_pod, __is_polymorphic, __is_union.
1436 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1437 (cp_parser_trait_expr): New.
1438 * semantics.c (finish_trait_expr, trait_expr_value
1439 classtype_has_nothrow_copy_or_assign_p): New.
1440 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1442 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1443 * class.c (check_bases, check_field_decl, check_bases_and_members):
1444 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1445 * pt.c (uses_template_parms, tsubst_copy_and_build,
1446 value_dependent_expression_p, type_dependent_expression_p): Deal with
1448 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1450 2007-03-29 Richard Guenther <rguenther@suse.de>
1452 * tree.c (cp_walk_subtrees): Do not set input_location.
1454 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1457 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1460 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1462 * parser.c (struct cp_parser): Update comment for
1463 greater_than_is_operator_p.
1464 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1465 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1466 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1467 !GREATER_THAN_IS_OPERATOR_P.
1468 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1469 `>>' operators that will become two `>' tokens in C++0x.
1470 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1471 mode, allowing it to terminate default arguments.
1472 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1473 `>>' like two consecutive `>' tokens.
1474 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1475 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1476 ends a template argument.
1478 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1480 * decl.c (redeclaration_error_message): Complain when redeclaring
1481 a friend function with default template arguments (C++0x mode only).
1482 * cp-tree.h (check_default_tmpl_args): Declare.
1483 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1484 template arguments in function templates. Add support for checking
1485 the default template arguments of friend templates.
1486 (push_template_decl_real): Fix call to check_default_tmpl_args.
1487 (type_unification_real): If a template parameter has not been
1488 deduced but provides a default template argument, substitute into
1489 that default template argument.
1490 * parser.c (cp_parser_init_declarator): When declaring (but not
1491 defining!) a function template in C++0x mode, check for default
1494 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1497 * decl.c (grokdeclarator): Deal with cv-qualified function type
1498 typedefs in the same way for member and non-member functions.
1500 2007-03-26 Dirk Mueller <dmueller@suse.de>
1502 * parser.c (cp_parser_member_declaration): Pedwarn
1503 about stray semicolons after member declarations.
1505 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1508 * pt.c (instantiate_decl): Set in_system_header.
1510 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1512 * cp-tree.h (current_tempalte_parms): Improve documentation.
1513 * pt.c (current_template_args): Likewise.
1516 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1517 not consume tokens when failing.
1519 2007-03-22 Jim Wilson <wilson@specifix.com>
1520 Mark Mitchell <mark@codesourcery.com>
1523 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1524 consistent with FROM.
1526 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1528 * error.c (dump_expr): Handle dependent names that designate types.
1529 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1531 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1533 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1535 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1537 * cvt.c (cp_convert_and_check) : Define.
1538 * cp-tree.h (cp_convert_and_check): Declare.
1539 * call.c (convert_conversion_warnings): Rename to
1540 conversion_null_warnings. The warning for floating-point to
1541 integer is handled by convert_and_check in convert_like_real.
1542 (convert_like_real): convert_conversion_warnings was renamed as
1543 conversion_null_warnings.
1544 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1545 overflow and changes of value during conversion.
1547 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1550 * parser.c (cp_parser_statement): If 'namespace' is found, this
1551 only can be a namespace alias definition, so parse it now.
1552 (cp_parser_namespace_alias_definition): if we find an open brace
1553 instead of '=', then this is actually a misplaced namespace
1556 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1559 * decl.c (cxx_init_decl_processing): Move command-line options
1560 processing to c-opts.c.
1562 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1564 * ptree.c (cxx_print_type): Use formatting markup for integers
1565 when printing template parameter index/level/orig level.
1566 (cxx_print_xnode): Ditto.
1567 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1568 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1569 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1571 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1572 rather than a HOST_WIDE_INT.
1573 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1574 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1576 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1577 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1578 IN_BASE_INITIALIZER bool bitfields.
1579 (struct cp_declarator): Make KIND a 4-bit field. Make
1580 PARAMETER_PACK_P a bool bitfield just after KIND.
1581 * pt.c (uses_parameter_packs): Destroy the pointer set.
1582 (make_pack_expansion): Ditto.
1583 (check_for_bare_parameter_packs): Ditto.
1584 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1586 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1589 * call.c (convert_default_arg): Instead of copying the node,
1592 2007-03-15 Dirk Mueller <dmueller@suse.de>
1595 * call.c (convert_conversion_warnings): New..
1596 (convert_like_real): .. factored out from here.
1597 (convert_conversion_warnings): Add warning about
1598 false being converted to NULL in argument passing.
1600 2007-03-14 Dirk Mueller <dmueller@suse.de>
1602 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1603 (finish_do_body): Warn about empty body in do/while statement.
1605 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1607 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1609 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1612 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1615 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1617 * cp/repo.c (init_repo): Initialize random_seed saved options.
1618 (finish_repo): Adjust.
1620 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1623 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1626 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1628 * decl.c (compute_array_index_type): New warning flag warn_vla.
1630 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1633 * call.c (convert_default_arg): Copy non-constant arguments.
1635 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1638 * parser.c (cp_parser_postfix_expression): Disallow compound
1639 literals in constant expressions.
1642 * semantics.c (finish_typeof): Use unlowered_expr_type.
1644 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1647 * cp-tree.h (unlowered_expr_type): New function.
1648 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1649 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1650 (unlowered_expr_type): New function.
1651 (build_unary_op): Disallow predecrements of bool bitfields.
1652 * call.c (build_conditional_expr): Use unlowered_expr_type.
1653 * pt.c (type_unification_real): Likewise.
1655 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1658 * typeck.c (check_return_expr): Check for bare parameter packs.
1659 (comptypes): Compare template parameter packs and
1660 type pack expansions.
1661 * decl.c (grokdeclarator): Deal with the declaration of function
1663 (grokparms): Verify that the (optional) function parameter pack is
1664 at the end of the parameter list.
1665 (xref_basetypes): Handle pack expansions in the base class.
1666 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1667 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1668 (NONTYPE_ARGUMENT_PACK): New.
1669 (TYPE_PACK_EXPANSION): New.
1670 (EXPR_PACK_EXPANSION): New.
1671 (ARGUMENT_PACK_SELECT): New.
1672 * cp-objcp-common.c (cp_tree_size): Compute size of
1673 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1674 ARGUMENT_PACK_SELECT.
1675 * error.c (dump_template_argument): Print template argument packs.
1676 (dump_template_argument_list): Ditto.
1677 (dump_template_parameter): Dump `...' for template type parameter
1679 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1680 (dump_parameters): Print function parameter packs.
1681 (dump_template_parms): Print template argument packs.
1682 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1683 (maybe_warn_variadic_templates): New.
1684 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1685 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1686 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1688 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1689 (write_template_arg): Write argument packs as separate arguments.
1690 * cp-tree.h (struct template_parm_index_s): Add flag that
1691 indicates that the template parameter is actually a parameter
1693 (struct tree_argument_pack_select): New.
1694 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1695 (union lang_tree_node): Add argument_pack_select.
1696 (FUNCTION_PARAMETER_PACK_P): New.
1697 (PACK_EXPANSION_P): New.
1698 (PACK_EXPANSION_PATTERN): New.
1699 (SET_PACK_EXPANSION_PATTERN): New.
1700 (PACK_EXPANSION_PARAMETER_PACKS): New.
1701 (ARGUMENT_PACK_P): New.
1702 (ARGUMENT_PACK_ARGS): New.
1703 (SET_ARGUMENT_PACK_ARGS): New.
1704 (ARGUMENT_PACK_INCOMPLETE_P): New.
1705 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1706 (TEMPLATE_PARM_PARAMETER_PACK): New.
1707 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1708 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1709 (ARGUMENT_PACK_SELECT_INDEX): New.
1710 (ARGUMENT_PACK_SELECT_ARG): New.
1711 (struct cp_declarator): Add parameter_pack_p flag.
1712 (maybe_warn_variadic_templates): Declare.
1713 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1714 indicate a template parameter pack.
1715 (uses_parameter_packs): Declare.
1716 (template_parameter_pack_p): Declare.
1717 (template_parms_variadic_p): Declare.
1718 (make_pack_expansion): Declare.
1719 (check_for_bare_parameter_packs): Declare.
1720 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1721 sizeof... expressions.
1722 (pp_cxx_expression): Print pack expansions and non-type argument
1724 (pp_cxx_exception_specification): Print pack expansions.
1725 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1726 (pp_cxx_ctor_initializer): Print pack expansions.
1727 (pp_cxx_type_id): Print pack expansions.
1728 (pp_cxx_template_argument_list): Print argument packs.
1729 (pp_cxx_template_parameter): Print ellipsis for template parameter
1731 * pt.c (comp_template_parms): Compare template parameter packs.
1732 (template_parameter_pack_p): New.
1733 (template_parms_variadic_p): New.
1734 (template_args_variadic_p): New.
1735 (make_ith_pack_parameter_name): New.
1736 (struct find_parameter_pack_data): New.
1737 (find_parameter_packs_r): New.
1738 (uses_parameter_packs): New.
1739 (make_pack_expansion): New.
1740 (check_for_bare_parameter_packs): New.
1741 (expand_template_argument_pack): New.
1742 (reduce_template_parm_level): Propagate parameter pack flag.
1743 (process_template_parm): Add is_parameter_pack parameter to state
1744 when the parameter is actually a parameter pack. Create template
1745 parameter packs when is_parameter_pack is true.
1746 (current_template_args): The argument for a template parameter
1747 pack is an argument pack containing a single pack expansion.
1748 (process_partial_specialization): When checking that non-type
1749 argument expressions do not involve template parameters, loop over
1750 the arguments in argument packs separately.
1751 (push_template_decl_real): Check that the type of the declaration
1752 does not have any bare parameter packs. Check that primary
1753 templates have no more than one parameter pack, and that it comes
1754 at the end of the template parameter list.
1755 (convert_template_argument): Handle coercions for pack expansion
1756 expressions by coercing the pattern then rebuilding the expansion.
1757 (coerce_template_parms): When coercing the arguments for a
1758 variadic template, pack "extra" arguments into an argument pack.
1759 (coerce_template_template_parms): Cannot coerce between parameter
1760 packs and non-pack parameters.
1761 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1762 (comp_template_args): Expand all template arguments packs before
1763 comparing template argument lists.
1764 (mangle_class_name_for_template): Make argument packs as separate
1766 (for_each_template_parm_r): No need to handle BASELINK.
1767 (instantiate_class_template): Handle pack expansions in the base
1769 (tsubst_pack_expansion): New.
1770 (tsubst_template_args): Handle substitutions of argument packs and
1771 pack expansion into template argument lists.
1772 (tsubst_decl): Expand function parameter packs into separate
1773 function parameters.
1774 (tsubst_arg_types): Expand a type pack expansion into separate
1776 (tsubst_exception_specification): Handle pack expansions in
1777 exception specifiers.
1778 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1779 replacing a template parameter with its argument. If we encounter
1780 a substitution for an argument pack, just return the parameter
1782 (tsubst_copy): sizeof(X...) returns the number of elements in
1783 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1784 PARM_DECL is a parameter pack.
1785 (tsubst_expr): Expression pack expansions and argument packs
1786 cannot show up here; they will all be handled through function
1787 calls, sizeof, and template argument lists.
1788 (tsubst_copy_and_build): sizeof(X...) returns the number of
1789 elements in parameter pack X. Handle pack expansions in TREE_LIST
1790 and CONSTRUCTOR nodes.
1791 (fn_type_unification): Handle "incomplete" explicit template
1792 argument lists that specify some of the arguments for a template
1794 (type_unification_real): Unify arguments against pack expansions.
1795 (template_parm_level_and_index): New, helper function.
1796 (unify_pack_expansion): New.
1797 (unify): Unify argument packs on an argument-by-argument basis,
1798 handling variadic argument packs as well.
1799 (more_specialized_fn): Handle unification of function parameter
1800 packs. All things being equal, prefer non-variadic function
1801 templates to variadic function templates.
1802 (more_specialized_class): Prefer the variadic class template
1803 partial specialization that binds fewer arguments to a parameter
1805 (regenerate_decl_from_template): Expand function parameter packs
1806 into separate parameters.
1807 (instantiate_decl): Ditto.
1808 (tsubst_initializer_list): Handle pack expansions for base-class
1810 (dependent_type_p_r): Determine dependent types in argument packs
1811 and pack expansions.
1812 (value_dependent_expression_p): Determine value-dependence of
1813 non-type argument packs.
1814 (dependent_template_arg_p): Handle argument packs.
1815 * semantics.c (finish_cond): Check for bare parameter packs.
1816 (finish_expr_stmt): Ditto.
1817 (finish_for_expr): Ditto.
1818 (finish_switch_cond): Ditto.
1819 (finish_mem_initializers): Ditto.
1820 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1822 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1823 * parser.c (make_declarator): Declarator is not an expansion.
1824 (make_pointer_declarator): Transfer parameter pack flag to outer
1826 (make_reference_declarator): Ditto.
1827 (make_ptrmem_declarator): Ditto.
1828 (make_call_declarator): Ditto.
1829 (make_array_declarator): Ditto.
1830 (cp_parser_postfix_expression): Allow pack expansion expressions
1831 in the argument list for a call expression.
1832 (cp_parser_parenthesized_expression_list): Add new parameter
1833 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1834 into separate arguments."
1835 (cp_parser_new_placement): Allow pack expansion expressions.
1836 (cp_parser_new_initializer): Ditto.
1837 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1838 base-class initializer expansion.
1839 (cp_parser_mem_initializer): Ditto.
1840 (cp_parser_template_parameter_list): Keep track of whether the
1841 template parameter is a template parameter pack.
1842 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1843 template parameter pack.
1844 (cp_parser_type_parameter): Ditto.
1845 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1847 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1848 this declarator is a parameter pack.
1849 (cp_parser_parameter_declaration): The ellipsis does not end the
1850 parameter declaration, because it might be a parameter pack. Parse
1851 the ellipsis to indicate a parameter pack.
1852 (cp_parser_initializer): Allow pack expansions.
1853 (cp_parser_initializer_list): Allow ellipsis to create an
1854 initializer expansion.
1855 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1857 (cp_parser_type_id_list): Allow ellipsis to create an exception
1858 specifier expansion.
1859 (cp_parser_attribute_list): Don't allow pack expansions.
1860 (cp_parser_functional_cast): Allow pack expansions.
1861 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1862 compute the length of a parameter pack.
1863 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1864 end a template argument.
1865 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1866 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1869 2007-03-09 Dirk Mueller <dmueller@suse.de>
1871 * cp/call.c (build_new_op): Call warn_logical_operator.
1873 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1876 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1879 * pt.c (any_template_arguments_need_structural_equality_p):
1882 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1884 * decl.c (grokdeclarator): Disable warnings for anonymous
1887 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1889 * typeck2.c (readonly_error): Always emit a hard error.
1890 Remove last argument.
1891 * cp-tree.h (readonly_error): Adjust prototype.
1892 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1893 * typeck.c (build_unary_op): Likewise.
1894 (build_modify_expr): Likewise.
1896 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1899 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1901 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1904 * parser.c (struct cp_parser): New IN_IF_STMT.
1905 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1906 returning if parsing the body of an 'if' statement or issuing an
1907 error and continuing.
1908 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1910 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1912 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1915 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1918 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1920 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1921 Objective-C++. Don't exit early if -shared-libgcc needs to be
1924 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1926 * typeck.c (common_base_type): Delete unused function.
1928 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1930 * Make-lang.in: Add dummy lang.install-pdf target.
1932 2007-03-01 Simon Baldwin <simonb@google.com>
1935 * decl.c (check_tag_decl): Added new warning for typedef ignored
1936 when it precedes an otherwise valid non-typedef declaration.
1938 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1940 * typeck.c (build_function_call): Store converted arguments
1941 in a stack-allocated array instead of building a list.
1942 (convert_arguments): Store arguments in the array passed in as an
1943 argument, and return the actual number of arguments.
1944 * call.c (build_call): Delete, and replace with...
1945 (build_call_n, build_call_a): New.
1946 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1947 (build_over_call): Store converted arguments in a stack-allocated
1948 array instead of building a list.
1949 (build_cxx_call): Pass arguments in an array instead of as a list.
1950 (build_java_interface_fn_ref): Rewrite to avoid constructing
1952 * tree.h: Update declarations to reflect above changes.
1953 * method.c (use_thunk): Use a stack-allocated array to hold
1954 the arguments instead of a list.
1955 * rtti.c (throw_bad_cast): Update call to cxx_call.
1956 (throw_bad_typeid): Likewise.
1957 (build_dynamic_cast_1): Likewise.
1958 * init.c (build_builtin_delete_call): Use build_call_n.
1959 * decl.c (expand_static_init): Likewise.
1960 * except.c (cp_protect_cleanup_actions): Likewise.
1961 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1962 (gimplify_must_not_throw_expr): Likewise.
1963 (cxx_omp_apply_fn): Use build_call_a.
1965 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1967 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1968 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1970 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1972 * cp-tree.h (static_ctors): Remove.
1973 * cp-tree.h (static_dtors): Likewise.
1974 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1975 refactoring of tree_map hierarchy.
1976 (decl_shadowed_for_var_insert): Likewise.
1977 * semantics.c (expand_body): Use c_expand_body.
1978 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1979 * decl2.c (static_ctors): Remove.
1980 (static_dtors): Likewise.
1981 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1982 objc_generate_static_init_call. Do not call static_[cd]tors.
1983 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1985 (cp_write_global_declarations): Likewise.
1987 2007-02-23 Richard Guenther <rguenther@suse.de>
1989 * class.c (note_name_declared_in_class): Make declaration
1990 changes meaning a pedwarn.
1992 2007-02-22 Michael Matz <matz@suse.de>
1995 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1996 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1997 dump_function_decl): Guard emitting outer scopes by new flag.
1998 * cp-lang.c (cxx_dwarf_name): New function.
1999 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2000 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2002 (push_template_decl_real, lookup_template_class): Remove calls
2005 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2007 * call.c (build_new_method_call): Ensure that explicit calls of
2008 destructors have type "void".
2010 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2012 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2013 and -Walways-true with -Waddress.
2014 * cvt.c (convert_to_void): Replace unconditional warning with
2017 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2019 * decl.c, tree.c: Fix comment typos.
2021 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2024 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2025 statement expression if we had an error mark node.
2027 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2028 Brooks Moses <brooks.moses@codesourcery.com>
2029 Lee Millward <lee.millward@codesourcery.com>
2031 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2032 Change class to tcc_vl_exp.
2034 * call.c (build_call): Use build_call_list instead
2036 (build_over_call): Likewise.
2037 (build_new_method_call): Use build_min_non_dep_call_list
2038 instead of build_min_non_dep.
2040 * error.c (dump_call_expr_args): New function.
2041 (dump_aggr_init_expr_args): New function.
2042 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2043 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2045 * cvt.c (convert_to_void): Use build_call_array instead
2046 of build3; use new AGGR_INIT_EXPR accessor macros.
2048 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2049 instead of TREE_CODE_LENGTH.
2051 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2052 AGGR_INIT_EXPR accessor macros.
2054 * cp-gimplify.c (cp_gimplify_init_expr): Use
2055 AGGR_INIT_EXPR_SLOT to set the slot operand.
2057 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2058 (AGGR_INIT_EXPR_SLOT): New macro.
2059 (AGGR_INIT_EXPR_ARG): New macro.
2060 (aggr_init_expr_nargs): New macro.
2061 (AGGR_INIT_EXPR_ARGP): New macro.
2062 (aggr_init_expr_arg_iterator): New.
2063 (init_aggr_init_expr_arg_iterator): New.
2064 (next_aggr_init_expr_arg): New.
2065 (first_aggr_init_expr_arg): New.
2066 (more_aggr_init_expr_args_p): New.
2067 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2068 (stabilize_aggr_init): New declaration.
2069 (build_min_non_dep_call_list): Likewise.
2071 * tree.c (process_aggr_init_operands): New function.
2072 (build_aggr_init_array) New function.
2073 (build_cplus_new): Update to use new CALL_EXPR and
2074 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2075 build_aggr_init_array.
2076 (build_min_non_dep_call_list) New function.
2077 (build_min_nt): Assert input code parameter is not a variable
2078 length expression class.
2079 (build_min, build_min_non_dep): Likewise.
2080 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2081 to check for equality instead of recursing. Handle tcc_vl_exp
2083 (stabilize_call): Update to only handle CALL_EXPRs, not
2084 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2085 (stabilize_aggr_init): New function.
2086 (stabilize_init): Use it.
2088 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2089 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2090 AGGR_INIT_EXPR accessor macros and argument iterators.
2092 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2093 build_vl_exp. Iterate through the operands, recursively
2094 processing each one.
2095 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2096 CALL_EXPR accessor macros.
2097 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2098 tree code classes. Use TREE_OPERAND_LENGTH instead of
2101 * semantics.c (finish_call_expr): Use build_nt_call_list
2102 instead of build_nt.
2103 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2104 accessor macros. Use build_call_array to construct the
2105 CALL_EXPR node instead of build3
2107 * decl2.c (build_offset_ref_call_from_tree): Use
2108 build_nt_call_list and build_min_non_dep_call_list instead
2109 of build_min_nt and build_min_non_dep.
2111 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2112 Use build_nt_call_list instead of build_min_nt.
2114 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2117 * call.c (build_conditional_expr): Improve error message.
2119 2007-02-13 Dirk Mueller <dmueller@suse.de>
2121 * friend.c (do_friend): Annotate warning about friend
2122 declarations in templates with OPT_Wnon_template_friend.
2123 Convert informal message from warning() to inform().
2125 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2126 Mark Mitchell <mark@codesourcery.com>
2129 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2130 instantiations for variables.
2132 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2135 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2136 Check warn_unused_value just once.
2138 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2141 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2142 (fn_type_unificiation): Likewise.
2143 (get_bindings): Likewise.
2145 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2148 * decl.c (finish_function): Use DECL_REPLACEABLE.
2149 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2151 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2153 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2155 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2157 * decl.c (grokvardecl): Don't error if !have_tls.
2158 (grokdeclarator): Likewise.
2159 * parser.c (cp_parser_omp_threadprivate): Likewise.
2161 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2164 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2165 parameters and result decls in omp clauses.
2166 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2169 2007-02-05 Dirk Mueller <dmueller@suse.de>
2172 * parser.c (cp_parser_class_specifier): Always initialize bases.
2174 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2176 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2177 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2178 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2180 * semantics.c (finish_omp_atomic): Store a whole expression node
2181 in operand 1, and integer_zero_node in operand 0, for dependent
2182 OMP_ATOMIC. Rewrite to make flow easier to understand.
2184 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2186 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2188 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2190 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2191 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2193 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2195 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2196 keyword warning to -Wc++0x-compat.
2198 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2200 * decl.c (grokdeclarator): Update documentation.
2202 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2205 * decl.c (grokdeclarator): If __thread is used together with
2206 a storage class other than extern and static, clear thread_p
2207 after issuing diagnostics and fall through to checking the
2210 2007-01-30 Roger Sayle <roger@eyesopen.com>
2212 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2213 calculating the size of an array (to avoid recursive errors).
2215 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2218 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2220 * call.c (convert_like_real): Don't warn when converting to
2223 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2225 * decl.c (pop_label): Replace warning with call to
2226 warn_for_unused_label.
2228 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2231 * semantics.c (finish_pseudo_destructor_expr): Check the
2232 destrutor name by calling check_dtor_name.
2234 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2236 * lex.c (D_CPP0X): Rename.
2238 (reswords): D_CPP0X -> D_CXX0X.
2239 (init_reswords): Ditto.
2240 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2241 of C++0x keywords as identifiers.
2243 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2246 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2249 2007-01-23 Ian Lance Taylor <iant@google.com>
2251 * typeck.c (convert_for_assignment): Only warn about a = b = c
2252 when converting to bool.
2254 2007-01-23 Roger Sayle <roger@eyesopen.com>
2256 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2258 * typeck.c (ignore_overflows): Remove the remaining uses of
2259 TREE_CONSTANT_OVERFLOW.
2261 2007-01-20 Jan Hubicka <jh@suse.cz>
2263 * decl2.c (start_objects, start_static_storage_duration_function):
2264 Do not make the functions uninlinable.
2266 2007-01-17 Ian Lance Taylor <iant@google.com>
2268 * class.c (add_method): Call VEC_reserve_exact rather than passing
2269 a negative size to VEC_reserve.
2271 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2274 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2276 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2279 * decl.c (make_typename_type): If the qualified name is not a
2280 type, issue an error.
2281 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2284 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2286 * rtti.c: Include target.h.
2287 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2288 don't emit typeinfo for fundamental types as weak.
2289 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2291 2007-01-08 Richard Guenther <rguenther@suse.de>
2293 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2295 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2297 * call.c (standard_conversion): Pass flag to
2298 vector_types_convertible_p to disallow emission of note.
2299 * typeck.c (convert_for_assignment): Pass flag to
2300 vector_types_convertible_p to allow emission of note.
2301 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2302 to disallow emission of note.
2304 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2307 * typeck.c (build_binary_op): Call overflow_warning if
2308 TREE_OVERFLOW_P is true for the result and not for any of the
2311 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2314 * class.c (add_method): Don't wait until template
2315 instantiation time to complain about duplicate methods.
2317 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2320 * semantics.c (finish_unary_op_expr): Warn only if result
2321 overflowed and operands did not.
2323 2007-01-05 Ian Lance Taylor <iant@google.com>
2325 * typeck.c (build_binary_op): Warn about comparing a non-weak
2328 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2330 * pt.c (tsubst): Propagate the need for structural equality checks
2331 when reducing the level of template parameters.
2333 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2335 * pt.c: Fix a comment typo.
2337 2007-01-02 Ian Lance Taylor <iant@google.com>
2339 * semantics.c (maybe_convert_cond): Optionally warn when using an
2340 assignment as a condition.
2341 * typeck.c (convert_for_assignment): Optionally warn about
2342 assigning the result of an assignment to a bool.
2344 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2346 * pt.c (canonical_template_parms): Correct typo in comment.
2348 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2350 * typeck.c (structural_comptypes): Renamed from "comptypes".
2351 (comptypes): Use canonical type information to perform fast type
2352 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2353 canonical type comparison returns the same results as we would see
2354 from the current, structural check. Support COMPARE_STRUCTURAL
2355 when we need structural checks.
2356 * decl.c (typename_compare): Fix comment.
2357 (build_typename_type): TYPENAME_TYPE nodes require structural
2358 equality checks, because they resolve different based on the
2360 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2361 require structural equality checks (for now).
2362 (build_ptrmemfunc_type): Build the canonical pointer to member
2364 (compute_array_index_type): Whenever we build a new index type
2365 to represent the size of an array in a template, we need to mark
2366 this index type as requiring structural equality. This goes for
2367 arrays with value-dependent sizes with the current ABI, or all
2369 * tree.c (cplus_array_hash): New.
2370 (struct cplus_array_info): New.
2371 (cplus_array_compare): New.
2372 (cplus_array_htab): New.
2373 (build_cplus_array_type_1): Use a hash table to cache the array
2374 types we build. Build the canonical array type for each array
2376 (cp_build_qualified_type_real): When building a cv-qualified array
2377 type, use the hash table of array types and build canonical array
2379 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2380 use structural equality (for now).
2381 * cp-tree.h (COMPARE_STRUCTURAL): New.
2382 * pt.c (canonical_template_parms): New.
2383 (canonical_type_parameter): New.
2384 (process_template_parm): Find the canonical type parameter.
2385 (lookup_template_class): When we have named the primary template
2386 type, set the canonical type for our template class to the primary
2387 template type. If any of the template arguments need structural
2388 equality checks, the template class needs structural equality
2390 (tsubst): When reducing the level of a template template
2391 parameter, we require structural equality tests for the resulting
2392 parameter because its template parameters have not had their types
2393 canonicalized. When reducing a template type parameter, find the
2394 canonical reduced type parameter.
2395 (any_template_arguments_need_structural_equality_p): New.