From cbd63935d8cb0edec8d27a7c427106b41d85a29f Mon Sep 17 00:00:00 2001 From: Kriang Lerdsuwanakij Date: Fri, 1 Aug 2003 15:06:02 +0000 Subject: [PATCH] PR c++/8442, c++/8806 PR c++/8442, c++/8806 * decl.c (qualify_lookup): Accept TEMPLATE_DECL if types are preferred. (check_elaborated_type_specifier): Add allow_template_p parameter. Check tag mismatch and class template. (xref_tag): Add template_header_p parameter. Add assertion that name is an IDENTIFIER_NODE. Remove implicit typename warning. Simplify lookup process if globalize is true. (cxx_init_decl_processing): Adjust call to xref_tag. (xref_tag_from_type): Likewise. * decl2.c (handle_class_head): Likewise. * parser.c (cp_parser_elaborated_type_specifier, cp_parser_class_head): Likewise. * rtti.c (init_rtti_processing, build_dynamic_cast1, tinfo_base_init, emit_support_tinfos): Likewise. * class.c (is_base_of_enclosing_class): Remove. * pt.c (convert_template_argument): Don't accept RECORD_TYPE as template template argument. * cp-tree.h (xref_tag): Adjust declaration. (is_base_of_enclosing_class): Remove. * NEWS: Document template template argument change. * g++.dg/template/elab1.C: Likewise. * g++.dg/template/type2.C: Likewise. * g++.dg/template/ttp3.C: Adjust expected error message. * g++.old-deja/g++.law/visibility13.C: Likewise. * g++.old-deja/g++.niklas/t135.C: Likewise. * g++.old-deja/g++.pt/ttp41.C: Likewise. * g++.old-deja/g++.pt/ttp43.C: Use qualified name for template template argument. * g++.old-deja/g++.pt/ttp44.C: Likewise. From-SVN: r70048 --- gcc/cp/ChangeLog | 24 ++ gcc/cp/NEWS | 13 ++ gcc/cp/class.c | 15 -- gcc/cp/cp-tree.h | 3 +- gcc/cp/decl.c | 212 +++++++++--------- gcc/cp/decl2.c | 2 +- gcc/cp/parser.c | 6 +- gcc/cp/pt.c | 26 +-- gcc/cp/rtti.c | 8 +- gcc/testsuite/ChangeLog | 13 ++ gcc/testsuite/g++.dg/template/elab1.C | 13 ++ gcc/testsuite/g++.dg/template/ttp3.C | 6 +- gcc/testsuite/g++.dg/template/type2.C | 16 ++ .../g++.old-deja/g++.law/visibility13.C | 2 +- gcc/testsuite/g++.old-deja/g++.niklas/t135.C | 4 +- gcc/testsuite/g++.old-deja/g++.pt/ttp41.C | 6 +- gcc/testsuite/g++.old-deja/g++.pt/ttp43.C | 8 +- gcc/testsuite/g++.old-deja/g++.pt/ttp44.C | 4 +- 18 files changed, 210 insertions(+), 171 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/elab1.C create mode 100644 gcc/testsuite/g++.dg/template/type2.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 83b901e36df..c50f99f6fb3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,27 @@ +2003-08-01 Kriang Lerdsuwanakij + + PR c++/8442, c++/8806 + * decl.c (qualify_lookup): Accept TEMPLATE_DECL if types are + preferred. + (check_elaborated_type_specifier): Add allow_template_p + parameter. Check tag mismatch and class template. + (xref_tag): Add template_header_p parameter. Add assertion + that name is an IDENTIFIER_NODE. Remove implicit typename + warning. Simplify lookup process if globalize is true. + (cxx_init_decl_processing): Adjust call to xref_tag. + (xref_tag_from_type): Likewise. + * decl2.c (handle_class_head): Likewise. + * parser.c (cp_parser_elaborated_type_specifier, + cp_parser_class_head): Likewise. + * rtti.c (init_rtti_processing, build_dynamic_cast1, + tinfo_base_init, emit_support_tinfos): Likewise. + * class.c (is_base_of_enclosing_class): Remove. + * pt.c (convert_template_argument): Don't accept RECORD_TYPE as + template template argument. + * cp-tree.h (xref_tag): Adjust declaration. + (is_base_of_enclosing_class): Remove. + * NEWS: Document template template argument change. + 2003-08-01 Nathan Sidwell * parser.c (cp_parser_init_declarator, diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS index 2642aeda0eb..00a50e4cd82 100644 --- a/gcc/cp/NEWS +++ b/gcc/cp/NEWS @@ -76,6 +76,19 @@ removed. * Covariant returns are implemented for all but varadic functions that require an adjustment. +* Inside the scope of a template class, the name of the class itself + is no longer a valid template template argument. Instead, you now have + to qualify the name by its scope. For example: + + template