diff options
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr46852.C | 7 |
4 files changed, 20 insertions, 1 deletions
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 <froydnj@codesourcery.com> + + PR c++/46852 + * parser.c (cp_parser_class_specifier): Check for TYPE_P. + 2010-12-15 Jakub Jelinek <jakub@redhat.com> 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 <froydnj@codesourcery.com> + + PR c++/46852 + * g++.dg/pr46852.C: New test. + 2010-12-16 Jan Hubicka <jh@suse.cz> 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 "" } |