https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124398
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We accept also
consteval auto
foo ()
{
constexpr int a = 42;
return ^^a;
}
int
bar ()
{
return [: foo () :];
}
which I think should be rejected as well (Dan's clang++ branch rejects it).
If it is static constexpr int a = 42; instead, it works in both compilers, so
perhaps it is just about automatic variables or variable_of parameters. Do
they have to be in that case from the current function (and in scope)? How
does one check for what is still in scope though? For constant evaluation we
have code to track that, but just when parsing some function?