diff options
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/error22.C | 9 |
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 96d7123..fcea368 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -2,6 +2,10 @@ PR c++/27805 * typeck2.c (build_m_component_ref): Use error_operand_p. + + PR c++/27821 + * decl.c (grokdeclarator): Return error_mark_node on + invalid uses of the scope resolution operator. 2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c801111..5bb61cb 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8151,7 +8151,7 @@ grokdeclarator (const cp_declarator *declarator, { /* Something like struct S { int N::j; }; */ error ("invalid use of %<::%>"); - decl = NULL_TREE; + return error_mark_node; } else if (TREE_CODE (type) == FUNCTION_TYPE) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9fd22de..e7d6f9d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -7,6 +7,9 @@ PR c++/27805 * g++.dg/parse/ptrmem6.C: New test. + + PR c++/27821 + * g++.dg/template/error22.C: New test. 2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> diff --git a/gcc/testsuite/g++.dg/template/error22.C b/gcc/testsuite/g++.dg/template/error22.C new file mode 100644 index 0000000..0593091 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/error22.C @@ -0,0 +1,9 @@ +//PR c++/27821 + +struct A +{ + template<void (A::*)()> struct B {}; + void ::foo(); // { dg-error "invalid use" } + B<&A::foo> b; // { dg-errror "incomplete type|template argument" } +}; + |