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
+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>
Jakub Jelinek <jakub@redhat.com>
}
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;
}
+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>
PR testsuite/83289
--- /dev/null
+// 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> ();
+}