From: Nathan Froyd Date: Thu, 16 Dec 2010 01:33:03 +0000 (+0000) Subject: re PR c++/46852 (ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_ma... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2d49fe5aa6529689c71df4a0635041725cb94d1;p=gcc.git re PR c++/46852 (ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in cp_parser_class_specifier, at cp/parser.c:16947) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b28af3c0c8f..e6a9610b29b 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 4c8ca7288c6..cb8b79782ef 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 8ca61f49918..94a48eb098b 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 00000000000..2c9d8dd4144 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr46852.C @@ -0,0 +1,7 @@ +// PR c++/46852 +// { dg-do compile } + +template +< +class +{ // { dg-error "" }