Commit 948587e7 by Jason Merrill Committed by Jason Merrill

re PR c++/48261 (internal compiler error: in lookup_template_function, at cp/pt.c:6227)

	PR c++/48261
	* pt.c (lookup_template_function): Handle non-function.

From-SVN: r175766
parent d816a3ba
2011-07-01 Jason Merrill <jason@redhat.com>
PR c++/48261
* pt.c (lookup_template_function): Handle non-function.
PR c++/48593
* pt.c (tsubst_qualified_id): Check PTRMEM_OK_P.
* tree.c (build_qualified_name): Set PTRMEM_OK_P.
......
......@@ -6622,8 +6622,12 @@ lookup_template_function (tree fns, tree arglist)
return error_mark_node;
gcc_assert (!arglist || TREE_CODE (arglist) == TREE_VEC);
gcc_assert (fns && (is_overloaded_fn (fns)
|| TREE_CODE (fns) == IDENTIFIER_NODE));
if (!is_overloaded_fn (fns) && TREE_CODE (fns) != IDENTIFIER_NODE)
{
error ("%q#D is not a function template", fns);
return error_mark_node;
}
if (BASELINK_P (fns))
{
......
2011-07-01 Jason Merrill <jason@redhat.com>
PR c++/48261
* g++.dg/template/template-id-3.C: New.
PR c++/48593
* g++.dg/template/qualified-id4.C: New.
......
// PR c++/48261
typedef double (*gaddType)(double,double);
struct Foo2
{
static gaddType add;
};
template<typename T>
struct Something
{
void work()
{
double x=T::template add<double>(5.0,6.0); // { dg-error "add" }
}
};
int main()
{
Something<Foo2> s2;
s2.work();
}
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