diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2007-05-25 20:26:36 +0000 |
---|---|---|
committer | Simon Martin <simartin@gcc.gnu.org> | 2007-05-25 20:26:36 +0000 |
commit | 1094da913be99ab5768f3a37bb955ae60f85006d (patch) | |
tree | 1e64bb39a5081cc53752f25e2be1fe856894fd75 /gcc/testsuite | |
parent | eb89f88cb853ff9e2604c9414360a312a39263ab (diff) | |
download | gcc-1094da913be99ab5768f3a37bb955ae60f85006d.zip gcc-1094da913be99ab5768f3a37bb955ae60f85006d.tar.gz gcc-1094da913be99ab5768f3a37bb955ae60f85006d.tar.bz2 |
re PR c++/31745 (ICE on invalid use of namespace)
2007-05-25 Simon Martin <simartin@users.sourceforge.net>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/31745
* parser.c (cp_parser_skip_to_closing_brace): Return true if the next
token is a closing brace, false if there are no tokens left.
(cp_parser_namespace_alias_definition): Only consume the next token if
it is a closing brace.
* parser.c (cp_parser_class_specifier): Likewise.
Co-Authored-By: Lee Millward <lee.millward@gmail.com>
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r125070
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/crash34.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/crash35.C | 7 |
3 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed41a7f..0da350c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2007-05-25 Simon Martin <simartin@users.sourceforge.net> + Lee Millward <lee.millward@gmail.com> + + PR c++/31745 + * g++.dg/parse/crash34.C: New test. + + * g++.dg/parse/crash35.C: New test. + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com> * gcc.target/i386/sse2-check.h: New. diff --git a/gcc/testsuite/g++.dg/parse/crash34.C b/gcc/testsuite/g++.dg/parse/crash34.C new file mode 100644 index 0000000..e2517a5 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash34.C @@ -0,0 +1,6 @@ +/* PR c++/31745 */ +/* { dg-do "compile" } */ + +void foo() +{ + namespace N { /* { dg-error "is not allowed|at end of input" } */ diff --git a/gcc/testsuite/g++.dg/parse/crash35.C b/gcc/testsuite/g++.dg/parse/crash35.C new file mode 100644 index 0000000..a0448af --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash35.C @@ -0,0 +1,7 @@ +/* This used to ICE. */ +/* { dg-do "compile" } */ + +struct a {}; + +class foo : public a, a +{ /* { dg-error "duplicate base type|at end of input" } */ |