Blame SOURCES/gcc8-pr86098.patch

61268d
2018-06-12  Jason Merrill  <jason@redhat.com>
61268d
61268d
	PR c++/86098 - ICE with template placeholder for TTP.
61268d
	* typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Check
61268d
	CLASS_PLACEHOLDER_TEMPLATE.
61268d
61268d
--- gcc/cp/typeck.c
61268d
+++ gcc/cp/typeck.c
61268d
@@ -1375,6 +1375,11 @@ structural_comptypes (tree t1, tree t2, int strict)
61268d
 	 template parameters set, they can't be equal.  */
61268d
       if (!comp_template_parms_position (t1, t2))
61268d
 	return false;
61268d
+      /* If T1 and T2 don't represent the same class template deduction,
61268d
+         they aren't equal.  */
61268d
+      if (CLASS_PLACEHOLDER_TEMPLATE (t1)
61268d
+	  != CLASS_PLACEHOLDER_TEMPLATE (t2))
61268d
+	return false;
61268d
       /* Constrained 'auto's are distinct from parms that don't have the same
61268d
 	 constraints.  */
61268d
       if (!equivalent_placeholder_constraints (t1, t2))
61268d
--- /dev/null
61268d
+++ gcc/testsuite/g++.dg/cpp1z/class-deduction58.C
61268d
@@ -0,0 +1,16 @@
61268d
+// PR c++/86098
61268d
+// { dg-additional-options -std=c++17 }
61268d
+
61268d
+template <class _Res> class future;
61268d
+template <class T> T&& declval();
61268d
+
61268d
+template<template <class...> class T>
61268d
+struct construct_deduced {
61268d
+  template <class... AN>
61268d
+  using deduced_t = decltype(T{declval<AN>()...});
61268d
+  template<class... AN>
61268d
+  deduced_t<AN...> operator()(AN&&... an) const;
61268d
+};
61268d
+
61268d
+template<class T>
61268d
+future<T> future_from(T singleSender);