+2018-12-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88184 - ICE when treating name as template-name.
+ * pt.c (lookup_template_function): Always build the TEMPLATE_ID_EXPR
+ with unknown_type_node.
+
2018-12-04 Julian Brown <julian@codesourcery.com>
* parser.c (cp_parser_oacc_wait_list): Fix error message and avoid
tree
lookup_template_function (tree fns, tree arglist)
{
- tree type;
-
if (fns == error_mark_node || arglist == error_mark_node)
return error_mark_node;
return fns;
}
- type = TREE_TYPE (fns);
- if (TREE_CODE (fns) == OVERLOAD || !type)
- type = unknown_type_node;
-
- return build2 (TEMPLATE_ID_EXPR, type, fns, arglist);
+ return build2 (TEMPLATE_ID_EXPR, unknown_type_node, fns, arglist);
}
/* Within the scope of a template class S<T>, the name S gets bound
+2018-12-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88184 - ICE when treating name as template-name.
+ * g++.dg/cpp2a/fn-template17.C: New test.
+ * g++.dg/cpp2a/fn-template18.C: New test.
+
2018-12-04 David Edelsohn <dje.gcc@gmail.com>
* gcc.dg/live-patching-2.c: Require LTO.
--- /dev/null
+// PR c++/88184
+// { dg-do compile }
+// { dg-options "-std=c++2a -fchecking=2" }
+
+namespace A
+{
+ void f ();
+}
+
+using A::f;
+
+template <typename T> void g ()
+{
+ f<T> (); // { dg-error "no matching function for call" }
+}
+
+void
+fn ()
+{
+ g<int>();
+}
--- /dev/null
+// PR c++/88184
+// { dg-do compile }
+// { dg-options "-std=c++2a -fchecking=2" }
+
+namespace A
+{
+ void f ();
+ void f (int);
+ void f (int, int);
+}
+
+using A::f;
+
+template <typename T> void g ()
+{
+ f<T> (); // { dg-error "no matching function for call" }
+}
+
+void
+fn ()
+{
+ g<int>();
+}