From b2d49fe5aa6529689c71df4a0635041725cb94d1 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Thu, 16 Dec 2010 01:33:03 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20c++/46852=20(ICE:=20tree=20check:=20ex?= =?utf8?q?pected=20class=20=E2=80=98type=E2=80=99,=20have=20=E2=80=98excep?= =?utf8?q?tional=E2=80=99=20(error=5Fmark)=20in=20cp=5Fparser=5Fclass=5Fsp?= =?utf8?q?ecifier,=20at=20cp/parser.c:16947)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc/cp/ PR c++/46852 * parser.c (cp_parser_class_specifier): Check for TYPE_P. gcc/testsuite/ PR c++/46852 * g++.dg/pr46852.C: New test. From-SVN: r167894 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/parser.c | 4 +++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/pr46852.C | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/pr46852.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b28af3c..e6a9610 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-12-15 Nathan Froyd + + PR c++/46852 + * parser.c (cp_parser_class_specifier): Check for TYPE_P. + 2010-12-15 Jakub Jelinek PR debug/46815 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 4c8ca72..cb8b797 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16937,7 +16937,9 @@ cp_parser_class_specifier (cp_parser* parser) break; } - if (want_semicolon) + /* If we don't have a type, then something is very wrong and we + shouldn't try to do anything clever. */ + if (TYPE_P (type) && want_semicolon) { cp_token_position prev = cp_lexer_previous_token_position (parser->lexer); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8ca61f4..94a48eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-12-15 Nathan Froyd + + PR c++/46852 + * g++.dg/pr46852.C: New test. + 2010-12-16 Jan Hubicka PR middle-end/46939 diff --git a/gcc/testsuite/g++.dg/pr46852.C b/gcc/testsuite/g++.dg/pr46852.C new file mode 100644 index 0000000..2c9d8dd --- /dev/null +++ b/gcc/testsuite/g++.dg/pr46852.C @@ -0,0 +1,7 @@ +// PR c++/46852 +// { dg-do compile } + +template +< +class +{ // { dg-error "" } -- 2.7.4