diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-10-10 21:49:27 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-10-10 21:49:27 +0000 |
commit | 22ab714dcceecb24c96599c9c7fe7b6c6db9b21f (patch) | |
tree | f11a3f43521d35d4a2cd8da4c105bf2c8516ae80 /gcc | |
parent | a82e1a7d187eeab0dee1ee832c364151d142c7c0 (diff) | |
download | gcc-22ab714dcceecb24c96599c9c7fe7b6c6db9b21f.zip gcc-22ab714dcceecb24c96599c9c7fe7b6c6db9b21f.tar.gz gcc-22ab714dcceecb24c96599c9c7fe7b6c6db9b21f.tar.bz2 |
re PR c++/17393 ("unused variable '._0'" warning with -Wall)
PR c++/17393
* decl.c (grokdeclarator): Robustify error-recovery on invalid
declarations.
PR c++/17393
* g++.dg/parse/error21.C: New test.
From-SVN: r88855
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/error21.C | 12 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3d7d740..65abf7d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-10-10 Mark Mitchell <mark@codesourcery.com> + + PR c++/17393 + * decl.c (grokdeclarator): Robustify error-recovery on invalid + declarations. + 2004-10-10 Gabriel Dos Reis <gdr@integrable-solutions.net> Convert diagnostics to use quoting flag q 7/n diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index fa50faa..f077566 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7765,7 +7765,7 @@ grokdeclarator (const cp_declarator *declarator, && ! bitfield) { error ("abstract declarator %qT used as declaration", type); - unqualified_id = make_anon_name (); + return error_mark_node; } /* Only functions may be declared using an operator-function-id. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3ec98ce3..d17818f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-10-10 Mark Mitchell <mark@codesourcery.com> + + PR c++/17393 + * g++.dg/parse/error21.C: New test. + 2004-10-10 Gabriel Dos Reis <gdr@integrable-solutions.net> * g++.dg/overload/pmf1.C: Adjust quoting marks. diff --git a/gcc/testsuite/g++.dg/parse/error21.C b/gcc/testsuite/g++.dg/parse/error21.C new file mode 100644 index 0000000..6e24ae2 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error21.C @@ -0,0 +1,12 @@ +// PR c++/17393 +// { dg-options "-Wall" } + +struct A { }; + +void foo() +{ + // Check that we do not complain about an unused + // compiler-generated variable. + A& = a; // { dg-error "token|declarator|not declared" } +} + |