Commit ea9e71de by Nathan Sidwell Committed by Nathan Sidwell

[PR C++/83287] Mark lookup for keeping

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00242.html
	PR c++/83287
	* tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.

	* g++.dg/lookup/pr83287.C: New.

From-SVN: r255429
parent 7109d224
2017-12-05 Nathan Sidwell <nathan@acm.org>
PR c++/83287
* tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.
2017-12-05 Martin Liska <mliska@suse.cz> 2017-12-05 Martin Liska <mliska@suse.cz>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
...@@ -3230,6 +3230,13 @@ build_min (enum tree_code code, tree tt, ...) ...@@ -3230,6 +3230,13 @@ build_min (enum tree_code code, tree tt, ...)
} }
va_end (p); va_end (p);
if (code == CAST_EXPR)
/* The single operand is a TREE_LIST, which we have to check. */
for (tree v = TREE_OPERAND (t, 0); v; v = TREE_CHAIN (v))
if (TREE_CODE (TREE_VALUE (v)) == OVERLOAD)
lookup_keep (TREE_VALUE (v), true);
return t; return t;
} }
......
2017-12-05 Nathan Sidwell <nathan@acm.org>
PR c++/83287
* g++.dg/lookup/pr83287.C: New.
2017-12-05 Jakub Jelinek <jakub@redhat.com> 2017-12-05 Jakub Jelinek <jakub@redhat.com>
PR testsuite/83289 PR testsuite/83289
......
// PR c++/83287 failed to keep lookup until instantiation time
void foo ();
namespace {
void foo (int);
}
template <class T>
void bar ()
{
T (*p)() = (T (*)(void)) foo;
}
void
baz ()
{
bar<void> ();
}
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