1. 27 Nov, 2009 1 commit
    • re PR c++/35112 (ICE and broken diagnostic with ambiguous class name) · 85539630
      /cp
      2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/35112
      	* pt.c (print_overloaded_functions): New.
      	(print_candidates): Call the latter.
      	* parser.c (cp_parser_class_name): Do not duplicate the diagnostics
      	after the cp_parser_lookup_name call.
      
      /testsuite
      2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/35112
      	* g++.dg/parse/crash53.C: New.
      	* g++.dg/parse/error17.C: Adjust, error messages are not
      	duplicated anymore.
      	* g++.dg/template/dtor7.C: Remove xfail-ed dg-bogus directives.
      
      From-SVN: r154698
      Paolo Carlini committed
  2. 26 Nov, 2009 3 commits
  3. 24 Nov, 2009 2 commits
  4. 23 Nov, 2009 2 commits
    • re PR middle-end/42095 (g++.dg/lto/20081118-1 cp_lto_20081118-1_0.o-cp_lto_20081118-1_1.o link) · 87501227
      	PR middle-end/42095
      	* tree.c: Include cgraph.h.
      	(cp_fix_function_decl_p): Don't return true for same_body aliases.
      	* Make-lang.in (cp/tree.o): Depend on $(CGRAPH_H).
      
      From-SVN: r154449
      Jakub Jelinek committed
    • re PR c++/14777 (typedef doesn't fully expose base class type) · aa373032
      Fix PR c++/14777
      
      gcc/cp/ChangeLog:
      
      	PR c++/14777
      	* cp-tree.def <TEMPLATE_INFO>: Declare new kind of tree
      	node.
      	* cp-tree.h (struct tree_template_info,
      	struct qualified_typedef_usage_s): New.
      	(cp_tree_node_structure_enum): add TS_CP_TEMPLATE_INFO.
      	(union lang_tree_node): Add template_info.
      	(TI_TEMPLATE, TI_ARGS, TI_TYPEDEFS_NEEDING_ACCESS_CHECKING):
      	Adjust.
      	(build_template_info): Declare.
      	(get_types_needing_access_check): Adjust return type.
      	(add_typedef_to_current_template_for_access_check): Declare.
      	* cp-objcp-common.c (cp_tree_size): Handle TEMPLATE_INFO.
      	* semantics.c (add_typedef_to_current_template_for_access_check):
      	Split from ...
      	(check_accessibility_of_qualified_id): ... here.
      	* decl.c (make_typename_type): Use it.
      	* pt.c (build_template_info): Define.
      	(check_explicit_specialization, find_parameter_packs_r,
      	push_template_decl_real, lookup_template_class,
      	for_each_template_parm_r, tsubst_decl, tsubst): Use
      	build_template_info.
      	(get_types_needing_access_check): Adjust return type.
      	(append_type_to_template_for_access_check_1): Record the
      	location of the usage point of the typedef. Adjust to TEMPLATE_INFO.
      	(append_type_to_template_for_access_check): Add new location
      	parameter. Pass it to append_type_to_template_for_access_check_1.
      	Adjust to TEMPLATE_INFO.
      	(perform_typedefs_access_check): Temporarily set input_location to
      	the usage point of the typedef we are checking access for. Adjust
      	to new TEMPLATE_INFO tree node.
      	* tree.c (bind_template_template_parm): Use build_template_info.
      	* call.c (add_template_candidate_real): Likewise.
      	* decl.c (grokfndecl): Likewise.
      	(cp_tree_node_structure): Handle TEMPLATE_INFO.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/14777
      	* g++.dg/template/typedef13.C: Adjust.
      	* g++.dg/template/typedef19.C: Adjust.
      	* g++.dg/template/typedef20.C: Adjust.
      	* g++.dg/template/typedef22.C: New test.
      
      From-SVN: r154443
      Dodji Seketeli committed
  5. 21 Nov, 2009 1 commit
    • PR c++/9050, DR 147, DR 318 · abd5730b
      	PR c++/9050, DR 147, DR 318
      	* parser.c (cp_parser_lookup_name): If the name matches the explicit
      	class scope, we're naming the constructor.
      	(cp_parser_constructor_declarator_p): Just use cp_parser_unqualified_id
      	if we have a nested-name-specifier.
      	(cp_parser_direct_declarator): Handle getting an overload set as a
      	constructor declarator.
      	(cp_parser_unqualified_id): Avoid looking up the constructor when
      	naming the destructor.
      	(cp_parser_diagnose_invalid_type_name): Give good
      	diagnostic for improper use of constructor as template.
      	* typeck.c (finish_class_member_access_expr): Give good diagnostic
      	about calling constructor.
      
      	* error.c (dump_aggr_type): Don't print A::A for injected-class-name.
      
      From-SVN: r154403
      Jason Merrill committed
  6. 20 Nov, 2009 5 commits
    • re PR c++/38646 (ICE with invalid specialization of variadic template) · 2282976b
      gcc/cp/
      
      2009-11-20  Simon Martin  <simartin@users.sourceforge.net>
      
      	PR c++/38646
      	* pt.c (process_partial_specialization): Do not turn wrongly located
      	parameter pack arguments into error_mark_node.
      	Split too long lines into two.
      
      gcc/testsuite/
      
      2009-11-20  Simon Martin  <simartin@users.sourceforge.net>
      
      	PR c++/38646
      	* g++.dg/cpp0x/pr38646.C: New test.
      
      From-SVN: r154378
      Simon Martin committed
    • re PR c++/42060 ([c++0x] ICE throwing array with initializer list) · 10d3a72a
      cp/
      2009-11-20  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/42060
      	* except.c (build_throw): Check the tree returned by
      	decay_conversion for error_mark_node.
      
      testsuite/
      2009-11-20  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/42060
      	* g++.dg/cpp0x/initlist28.C: New.
      
      From-SVN: r154371
      Paolo Carlini committed
    • re PR c++/29017 (%s substituted with different untranslated words can't be properly translated) · c86818cf
      /cp
      2009-11-20  Shujing Zhao  <pearly.zhao@oracle.com>
      
      	PR c++/29017
      	* cp-tree.h (composite_pointer_operation): New type.
      	(composite_pointer_type): Adjust prototype with new argument.
      	* typeck.c (composite_pointer_type): Accept
      	composite_pointer_operation as argument and emit diagnostic to be
      	visible to gettext and checked at compile time.
      	(composite_pointer_type_r): Likewise.
      	(common_pointer_type): Update call to composite_pointer_type.
      	(cp_build_binary_op): Likewise.
      	* call.c (build_conditional_expr): Likewise.
      
      /testsuite
      2009-11-20  Shujing Zhao  <pearly.zhao@oracle.com>
      
      	* g++.old-deja/g++.jason/rfg20.C: Make expected dg-error strings
      	explicit.
      	* g++.old-deja/g++.rfg/00321_01-.C: Likewise.
      	* g++.old-deja/g++.rfg/00324_02-.C: Likewise.
      	* g++.old-deja/g++.law/typeck1.C: Likewise.
      	* g++.old-deja/g++.bugs/900324_02.C: Likewise.
      	* g++.dg/conversion/ptrmem9.C: Likewise.
      	* g++.dg/expr/cond2.C: Likewise.
      
      From-SVN: r154360
      Shujing Zhao committed
    • re PR c++/42115 (r154072 & r154073 break build of ppl, non-placement deallocation issue) · 5cd25f07
      	PR c++/42115
      	* call.c (build_op_delete_call): Don't complain about using
      	op delete (void *, size_t) for placement delete if there's an
      	op delete (void *).
      
      From-SVN: r154357
      Jason Merrill committed
    • DR 176 permissiveness · 98fba7f7
      	DR 176 permissiveness
      gcc/
      	* dwarf2out.c (get_context_die): Take TYPE_MAIN_VARIANT.
      gcc/cp/
      	* class.c (build_self_reference): Call set_underlying_type.
      	* decl.c (check_elaborated_type_specifier): Don't complain about
      	injected-class-name.
      	(type_is_deprecated): Use TYPE_MAIN_VARIANT.
      	* pt.c (convert_template_argument): Handle injected-class-name used
      	as template template argument.
      	* typeck2.c (abstract_virtuals_error): Use TYPE_MAIN_VARIANT.
      
      From-SVN: r154354
      Jason Merrill committed
  7. 19 Nov, 2009 1 commit
  8. 18 Nov, 2009 2 commits
    • re PR c++/40892 (maybe_warn_cpp0x i18n problems) · 848f237b
      /cp
      2009-11-18  Shujing Zhao  <pearly.zhao@oracle.com>
      
      	PR c++/40892
      	* error.c (maybe_warn_cpp0x): Accept enum cpp0x_warn_str as argument.
      	(maybe_warn_variadic_templates): Update the maybe_warn_cpp0x calls to
      	match the new declaration.
      	* cp-tree.h (cpp0x_warn_str): New type.
      	(maybe_warn_cpp0x): Adjust prototype with new argument.
      	* call.c (reference_binding): Update the maybe_warn_cpp0x calls.
      	* decl.c (reshape_init_r, check_initializer, grokdeclarator):
      	Likewise.
      	* parser.c (cp_parser_primary_expression)
      	(cp_parser_parenthesized_expression_list, cp_parser_new_initializer)
      	(cp_parser_assignment_expression, cp_parser_condition)
      	(cp_parser_jump_statement, cp_parser_mem_initializer)
      	(cp_parser_simple_type_specifier, cp_parser_elaborated_type_specifier)
      	(cp_parser_enum_specifier, cp_parser_initializer)
      	(cp_parser_pure_specifier, cp_parser_functional_cast): Likewise.
      
      /testsuite
      2009-11-18  Shujing Zhao  <pearly.zhao@oracle.com>
      
      	* g++.old-deja/g++.other/crash28.C: Make expected dg-error strings
      	explicit.
      	* g++.dg/inherit/error4.C: Likewise.
      	* g++.dg/template/crash90.C: Likewise.
      
      From-SVN: r154288
      Shujing Zhao committed
    • re PR c++/3187 (gcc lays down two copies of constructors) · b2583345
      	PR c++/3187
      	* cgraph.h (struct cgraph_node): Add same_body and same_body_alias
      	fields.
      	(cgraph_same_body_alias, cgraph_remove_same_body_alias): New
      	prototypes.
      	* cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks,
      	cgraph_materialize_all_clones): Handle same_body aliases.
      	* cgraph.c (cgraph_allocate_node): New function.
      	(cgraph_create_node): Use it.
      	(cgraph_node_for_decl, cgraph_node, cgraph_get_node,
      	cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases.
      	(cgraph_same_body_alias, cgraph_remove_same_body_alias): New
      	functions.
      	* lto-cgraph.c (lto_output_node): Stream out same_body aliases.
      	(input_node): Stream in same_body aliases.
      	* lto-symtab.c (lto_cgraph_replace_node): Clear node pointers
      	for same_body aliases.
      	(lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases.
      
      	* cp-tree.h (expand_or_defer_fn_1): New prototype.
      	* decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL
      	also all same_body aliases.
      	* semantics.c (expand_or_defer_fn): Move most of the function
      	except registering with cgraph to ...
      	(expand_or_defer_fn_1): ... here.  New function.
      	* optimize.c: Include cgraph.h.
      	(maybe_clone_body): If in charge parm is not used and both base
      	and complete clones are created and are not comdat, tell cgraph
      	they have the same body.
      	* Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H).
      
      	* g++.dg/abi/mangle26.C: Also match *C2* definition.
      	* g++.dg/abi/mangle27.C: Likewise.
      	* g++.dg/abi/mangle28.C: Likewise.
      	* g++.dg/abi/mangle29.C: Likewise.
      
      From-SVN: r154284
      Jakub Jelinek committed
  9. 17 Nov, 2009 4 commits
  10. 16 Nov, 2009 3 commits
    • PR c++/13950, DR 176 · 5a080ad7
      	PR c++/13950, DR 176
      	* search.c (lookup_field_r): Allow lookup to find the
      	injected-class-name from a template base.
      	(template_self_reference_p): Remove.
      	* decl.c (make_typename_type): Diagnose ambiguity.  Use
      	maybe_get_template_decl_from_type_decl.
      	* parser.c (cp_parser_template_name): Pass true to is_template
      	rather than use maybe_get_template_decl_from_type_decl.
      	(cp_parser_lookup_name): Use maybe_get_template_decl_from_type_decl.
      	* pt.c (maybe_get_template_decl_from_type_decl): Handle ambiguity.
      	Use DECL_SELF_REFERENCE_P.
      
      	* parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
      	Avoid duplicate ambiguity error.
      	* error.c (dump_decl): Don't say "typedef" for injected-class-name.
      	* pt.c (convert_template_argument): Tweak logic.
      
      From-SVN: r154223
      Jason Merrill committed
    • re PR c++/42055 (ICE with ambiguous template specialization) · 3cb9d1d5
      cp/
      2009-11-16  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/42055
      	* pt.c (determine_specialization): Assign to candidates the return
      	value of the chainon called before print_candidates.
      
      testsuite/
      2009-11-16  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/42055
      	* testsuite/g++.dg/template/crash92.C: New.
      
      From-SVN: r154202
      Paolo Carlini committed
    • re PR c++/32056 (Storage classes on template parameters) · 0229b692
      cp/
      2009-11-16  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/32056
      	* decl.h (enum decl_context): Add TPARM enumerator.
      	* decl.c (grokdeclarator): Per 14.1/2, error out if a storage class
      	is specified in a template parameter declaration.
      	* parser.c (cp_parser_template_parameter): Call grokdeclarator with
      	TPARM as third argument.
      
      testsuite/
      2009-11-16  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/32056
      	* testsuite/g++.dg/template/error44.C: New.
      
      From-SVN: r154198
      Paolo Carlini committed
  11. 13 Nov, 2009 6 commits
  12. 12 Nov, 2009 7 commits
  13. 11 Nov, 2009 1 commit
  14. 10 Nov, 2009 2 commits