diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2008-08-14 15:11:01 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-08-14 15:11:01 +0000 |
commit | 0450a9665e7b06791114a521a20a691e2a1dbf2b (patch) | |
tree | 261fefd5e9c3bbac96f4a939e6f96d4a72ec2d3b /gcc/cp/decl.c | |
parent | 4265559a69290dee56a0df1e7d83610a869b02fc (diff) | |
download | gcc-0450a9665e7b06791114a521a20a691e2a1dbf2b.zip gcc-0450a9665e7b06791114a521a20a691e2a1dbf2b.tar.gz gcc-0450a9665e7b06791114a521a20a691e2a1dbf2b.tar.bz2 |
re PR c++/34600 (ICE with invalid use of extern)
/cp
2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/34600
* decl.c (grokdeclarator): In case of extern and initializer, return
error_mark_node after the error.
/testsuite
2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/34600
* g++.dg/parse/crash43.C: New.
From-SVN: r139099
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3cd2511..b053160 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9270,7 +9270,10 @@ grokdeclarator (const cp_declarator *declarator, warning (0, "%qs initialized and declared %<extern%>", name); } else - error ("%qs has both %<extern%> and initializer", name); + { + error ("%qs has both %<extern%> and initializer", name); + return error_mark_node; + } } /* Record `register' declaration for warnings on & |