From ca099ac8c57c9858373cf83befdfae7bab8e4a4e Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 24 Feb 2003 07:43:23 +0000 Subject: re PR c++/5333 (ICE on nested template classes using other nested template classes) PR c++/5333 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro. * parser.c (cp_parser_diagnose_invalid_type_name): Use it. * pt.c (instantiate_class_template): Don't try to instantiate dependent types. (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE. PR c++/5333 * g++.dg/parse/fused-params1.C: Adjust error messages. * g++.dg/template/nested3.C: New test. From-SVN: r63354 --- gcc/cp/parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gcc/cp/parser.c') diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 79ec8be..0688cdc 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1954,10 +1954,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser) template (which will have an empty TYPE_FIELDs), to the main version. */ if (CLASSTYPE_USE_TEMPLATE (base_type)) - base_type = (TREE_TYPE - (DECL_TEMPLATE_RESULT - (DECL_PRIMARY_TEMPLATE - (CLASSTYPE_TI_TEMPLATE (base_type))))); + base_type = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (base_type); for (field = TYPE_FIELDS (base_type); field; field = TREE_CHAIN (field)) @@ -4526,6 +4523,7 @@ cp_parser_unary_operator (cp_token* token) /* Parse a new-expression. + new-expression: :: [opt] new new-placement [opt] new-type-id new-initializer [opt] :: [opt] new new-placement [opt] ( type-id ) new-initializer [opt] -- cgit v1.1