/* We also don't want to evaluate concept-checks when substituting the
constraint-expressions of a declaration. */
processing_constraint_expression_sentinel s;
+ cp_unevaluated u;
tree expr = tsubst_expr (t, args, complain, in_decl, false);
return expr;
}
/* Compute the value of the constraint. */
if (info.noisy ())
- result = cxx_constant_value (result);
+ {
+ iloc_sentinel ils (EXPR_LOCATION (result));
+ result = cxx_constant_value (result);
+ }
else
{
result = maybe_constant_value (result, NULL_TREE,
else
result = tsubst (pattern, args, complain, in_decl);
result = make_pack_expansion (result, complain);
+ PACK_EXPANSION_LOCAL_P (result) = PACK_EXPANSION_LOCAL_P (t);
+ PACK_EXPANSION_SIZEOF_P (result) = PACK_EXPANSION_SIZEOF_P (t);
if (PACK_EXPANSION_AUTO_P (t))
{
/* This is a fake auto... pack expansion created in add_capture with
--- /dev/null
+// PR c++/100138
+// { dg-do compile { target c++20 } }
+
+template <class T>
+struct A {
+ A(T, auto... xs) requires (sizeof...(xs) != 0);
+};
+
+constexpr bool f(...) { return true; }
+
+template <class T>
+struct B {
+ B(T, auto... xs) requires (f(xs...)); // { dg-error "constant expression" }
+};
+
+template <class T>
+struct C {
+ C(T, auto x) requires (f(x)); // { dg-error "constant expression" }
+};
+
+int main() {
+ A x{1, 2}; // { dg-bogus "" }
+ B y{1, 2}; // { dg-error "deduction|no match" }
+ C z{1, 2}; // { dg-error "deduction|no match" }
+}