https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01274.html
PR c++/85634
* friend.c (add_friend): Keep lookup sets of tempate sets.
PR c++/85634
* g++.dg/lookup/pr85634-2.C: New.
From-SVN: r261817
+2018-06-20 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/85634
+ * friend.c (add_friend): Keep lookup sets of tempate sets.
+
2018-06-20 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokfndecl): Add const cp_decl_specifier_seq* parameter;
if (decl == error_mark_node)
return;
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_TEMPLATE_INSTANTIATION (decl))
+ /* We'll have parsed this as a declaration, and therefore not
+ marked the lookup set for keeping. Do that now. */
+ lookup_keep (DECL_TI_TEMPLATE (decl));
+
typedecl = TYPE_MAIN_DECL (type);
list = DECL_FRIENDLIST (typedecl);
name = DECL_NAME (decl);
+2018-06-20 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/85634
+ * g++.dg/lookup/pr85634-2.C: New.
+
2018-06-20 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/template/friend65.C: New.
--- /dev/null
+// PR c++/85634
+
+namespace bsl {
+ template <class T> void frob (const T *);
+}
+
+using namespace bsl;
+
+template<class VALUE> void frob (const VALUE &);
+
+template <typename T>
+struct TPL {
+ friend void frob <T> (const T &);
+};
+
+TPL<int> x;