This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] PR 32113
- From: Paolo Carlini <pcarlini at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 29 Aug 2007 13:23:25 +0200
- Subject: [C++ Patch] PR 32113
Hi,
tested x86_64-linux, Ok for the active branches?
Thanks,
Paolo.
////////////////
/cp
2007-08-29 Paolo Carlini <pcarlini@suse.de>
PR c++/32113
* search.c (lookup_member): Check the name argument for
error_mark_node.
/testsuite
2007-08-29 Paolo Carlini <pcarlini@suse.de>
PR c++/32113
* g++.dg/template/crash70.C: New.
Index: testsuite/g++.dg/template/crash70.C
===================================================================
*** testsuite/g++.dg/template/crash70.C (revision 0)
--- testsuite/g++.dg/template/crash70.C (revision 0)
***************
*** 0 ****
--- 1,7 ----
+ // PR c++/32113
+
+ template<int> struct A;
+
+ template<typename T> void foo (A<&T::template i>); // { dg-error "not a template" }
+
+ template void foo<A<0> > (A<0>); // { dg-error "does not match" }
Index: cp/search.c
===================================================================
*** cp/search.c (revision 127884)
--- cp/search.c (working copy)
*************** lookup_member (tree xbasetype, tree name
*** 1199,1204 ****
--- 1199,1207 ----
const char *errstr = 0;
+ if (name == error_mark_node)
+ return NULL_TREE;
+
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (TREE_CODE (xbasetype) == TREE_BINFO)