aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-11 00:14:37 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-08-11 00:14:37 +0000
commit550205c3aefe911b63cdd13defd687a630dbc225 (patch)
treeb5534047695c46651960845875efb6b7b2e1672e /gcc
parentc295317dfb5149439fc2ac7d3cf12cfa93ec9db4 (diff)
downloadgcc-550205c3aefe911b63cdd13defd687a630dbc225.zip
gcc-550205c3aefe911b63cdd13defd687a630dbc225.tar.gz
gcc-550205c3aefe911b63cdd13defd687a630dbc225.tar.bz2
re PR c++/16971 (ICE on duplicate definition)
PR c++/16971 * parser.c (cp_parser_init_declarator): Robustify. PR c++/16971 * g++.dg/parse/crash16.C: New test. From-SVN: r85776
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/parse/crash16.C8
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index be759c5..269b20b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/16971
+ * parser.c (cp_parser_init_declarator): Robustify.
+
2004-08-06 Richard Sandiford <rsandifo@redhat.com>
* typeck2.c (process_init_constructor): Guard the missing field warning
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d6aadb3..2176e05 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -10702,7 +10702,7 @@ cp_parser_init_declarator (cp_parser* parser,
/* Finish processing the declaration. But, skip friend
declarations. */
- if (!friend_p && decl)
+ if (!friend_p && decl && decl != error_mark_node)
{
cp_finish_decl (decl,
initializer,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2dda1e5..022280c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/16971
+ * g++.dg/parse/crash16.C: New test.
+
2004-08-10 Roger Sayle <roger@eyesopen.com>
* gcc.dg/mips-rsqrt-1.c: New test case.
diff --git a/gcc/testsuite/g++.dg/parse/crash16.C b/gcc/testsuite/g++.dg/parse/crash16.C
new file mode 100644
index 0000000..dc8f7a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash16.C
@@ -0,0 +1,8 @@
+// PR c++/16971
+
+namespace N {
+ int i; // { dg-error "" }
+ // By checking for an explicit keyword on the next line we avoid
+ // matching an ICE message.
+ int i; // { dg-error "redefinition" }
+}