Blame SOURCES/gcc8-pr86098.patch

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