diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2010-12-16 01:33:03 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2010-12-16 01:33:03 +0000 |
commit | b2d49fe5aa6529689c71df4a0635041725cb94d1 (patch) | |
tree | af00132afb5ddfd4085a0156def5c76355102427 /gcc/cp/parser.c | |
parent | 5210bbc5aad878af293a6535973a635c98c6ac47 (diff) | |
download | gcc-b2d49fe5aa6529689c71df4a0635041725cb94d1.zip gcc-b2d49fe5aa6529689c71df4a0635041725cb94d1.tar.gz gcc-b2d49fe5aa6529689c71df4a0635041725cb94d1.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |