2016-08-04 Jason Merrill <jason@redhat.com>
+ PR c++/72415
+ * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
+ of the TREE_VEC.
+
* cp-tree.h (TYPE_UNNAMED_P): Rename from TYPE_ANONYMOUS_P.
(TYPE_WAS_UNNAMED): Rename from TYPE_WAS_ANONYMOUS.
* class.c, decl.c, decl2.c, error.c, lambda.c, mangle.c,
local_specializations = saved_local_specializations;
}
+ /* If the dependent pack arguments were such that we end up with only a
+ single pack expansion again, there's no need to keep it in a TREE_VEC. */
+ if (len == 1 && TREE_CODE (result) == TREE_VEC
+ && PACK_EXPANSION_P (TREE_VEC_ELT (result, 0)))
+ return TREE_VEC_ELT (result, 0);
+
return result;
}
--- /dev/null
+// PR c++/72415
+// { dg-options "-std=c++1z -fconcepts" }
+
+template<int... Indices>
+struct indices {};
+
+template<typename Dummy>
+struct foo_type {
+ template<int... Indices>
+ static void impl(indices<Indices...>)
+ requires (... && (Indices, true));
+
+ static auto caller()
+ { return impl(indices<0, 1, 2> {}); }
+};
+
+int main()
+{
+ // internal compiler error: in satisfy_predicate_constraint, at cp/constraint.cc:2013
+ foo_type<void>::caller();
+}