And here's the patch for gcc-8.

nathan
--
Nathan Sidwell
2018-06-20  Nathan Sidwell  <nat...@acm.org>

	PR c++/85634 - tsubst ICE on unmarked lookup
	* parser.c (cp_parser_primary_expression): Keep lookup in template.

	PR c++/85634 - tsubst ICE on unmarked lookup
	* g++.dg/lookup/pr85634.C: New.

Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c	(revision 261802)
+++ gcc/cp/parser.c	(working copy)
@@ -5609,6 +5609,9 @@ cp_parser_primary_expression (cp_parser
 	      }
 	  }
 
+	if (processing_template_decl && is_overloaded_fn (decl))
+	  lookup_keep (get_fns (decl), true);
+
 	decl = (finish_id_expression
 		(id_expression, decl, parser->scope,
 		 idk,
Index: gcc/testsuite/g++.dg/lookup/pr85634.C
===================================================================
--- gcc/testsuite/g++.dg/lookup/pr85634.C	(revision 0)
+++ gcc/testsuite/g++.dg/lookup/pr85634.C	(working copy)
@@ -0,0 +1,18 @@
+// PR c++/85634 ICE managing lookup set
+
+namespace N {
+  template <class T> void Foo (T *const &);
+}
+
+using namespace N;
+
+template<class T> void Foo (const T &);
+
+
+template <class T>
+void Frob()
+{
+  void (*op)(const T&) = Foo;
+}
+
+template void Frob<int *>();

Reply via email to