Message ID | 4C8F8BCF.2020304@oracle.com |
---|---|
State | New |
Headers | show |
... I'm applying this as approved by Jason off-line. Paolo.
Index: testsuite/g++.dg/template/crash103.C =================================================================== --- testsuite/g++.dg/template/crash103.C (revision 0) +++ testsuite/g++.dg/template/crash103.C (revision 0) @@ -0,0 +1,4 @@ +// PR c++/45665 + +template < typename > struct S; +void (S <0>::*ptr) (); // { dg-error "type" } Index: cp/decl.c =================================================================== --- cp/decl.c (revision 164279) +++ cp/decl.c (working copy) @@ -8762,6 +8762,8 @@ grokdeclarator (const cp_declarator *declarator, type = build_memfn_type (type, declarator->u.pointer.class_type, memfn_quals); + if (type == error_mark_node) + return error_mark_node; memfn_quals = TYPE_UNQUALIFIED; }