re PR c++/27821 (ICE with invalid ptr-to-member)

PR c++/27821
* decl.c (grokdeclarator): Return error_mark_node on
invalid uses of the scope resolution operator.

From-SVN: r114899
This commit is contained in:
Lee Millward 2006-06-22 18:05:17 +00:00 committed by Lee Millward
parent 0ef9029680
commit 9a171ca4b0
4 changed files with 17 additions and 1 deletions

View File

@ -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>

View File

@ -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)
{

View File

@ -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>

View File

@ -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" }
};