c++: std::is_constant_evaluated inside constraint [PR97051]
authorPatrick Palka <ppalka@redhat.com>
Sat, 19 Sep 2020 15:17:41 +0000 (11:17 -0400)
committerPatrick Palka <ppalka@redhat.com>
Sat, 19 Sep 2020 15:17:41 +0000 (11:17 -0400)
commitdea470d09155f2007bdd502c16614128cb6f9348
tree834719a35164db0c246a1e4addb2f00b2495f84b
parent83858ba1db31cd83667592a41d71315090459da4
c++: std::is_constant_evaluated inside constraint [PR97051]

According to [expr.const]/14, the result of substitution into an atomic
constraint is manifestly constant-evaluated; this patch adjusts the call
to maybe_constant_value in satisfy_atom to that effect.

gcc/cp/ChangeLog:

PR c++/97051
* constraint.cc (satisfy_atom): Pass true as the
manifestly_const_eval argument to maybe_constant_value.

gcc/testsuite/ChangeLog:

PR c++/97051
* g++.dg/cpp2a/is-constant-evaluated11.C: New test.
gcc/cp/constraint.cc
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated11.C [new file with mode: 0644]