PR c++/48261
* pt.c (lookup_template_function): Handle non-function.
From-SVN: r175766
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.
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.
--- /dev/null
+// 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();
+}