Commit 4864cc4a by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

re PR c++/12924 (ICE in lookup_member, at cp/search.c:1228)

	PR c++/12924
	* typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR
	with OVERLOAD and DECL nodes as the first operand.

	* g++.dg/template/template-id-2.C: New test.

From-SVN: r73851
parent 539edbe0
2003-11-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/12924
* typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR
with OVERLOAD and DECL nodes as the first operand.
2003-11-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* pt.c (tsubst) <ARRAY_REF>: Remove erroneous argument to build_nt.
......
......@@ -1860,6 +1860,11 @@ finish_class_member_access_expr (tree object, tree name)
is_template_id = true;
template_args = TREE_OPERAND (name, 1);
name = TREE_OPERAND (name, 0);
if (TREE_CODE (name) == OVERLOAD)
name = DECL_NAME (get_first_fn (name));
else if (DECL_P (name))
name = DECL_NAME (name);
}
if (TREE_CODE (name) == SCOPE_REF)
......
2003-11-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/12924
* g++.dg/template/template-id-2.C: New test.
2003-11-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/5369
......
// { dg-do compile }
// Origin: Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
// PR c++/12924
template<typename> struct A {};
template<> struct A<void>
{
template<typename T> void foo()
{
A<T> a;
a.template foo<int>(); // { dg-error "no member" }
}
};
void bar()
{
A<void> a;
a.foo<int>(); // { dg-error "instantiated" }
}
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