Commit 22f309bc by Marek Polacek Committed by Marek Polacek

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.

	* g++.dg/cpp2a/fn-template17.C: New test.
	* g++.dg/cpp2a/fn-template18.C: New test.

From-SVN: r266793
parent de117207
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
......
......@@ -9068,8 +9068,6 @@ add_pending_template (tree d)
tree
lookup_template_function (tree fns, tree arglist)
{
tree type;
if (fns == error_mark_node || arglist == error_mark_node)
return error_mark_node;
......@@ -9090,11 +9088,7 @@ lookup_template_function (tree fns, tree arglist)
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.
......
// 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>();
}
// 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>();
}
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