Commit 9a171ca4 by Lee Millward Committed by Lee Millward

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
parent 0ef90296
......@@ -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>
......
......@@ -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)
{
......
......@@ -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>
//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" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment