https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124219
--- Comment #2 from chzn at mail dot ustc.edu.cn <chzn at mail dot ustc.edu.cn> --- (In reply to Jakub Jelinek from comment #1) > Isn't this behavior correct? > I mean neither of the lambdas are consteval (nor escalated to consteval), > both are (I think constexpr implicitly), the inner one is constant evaluated > (but doesn't have to be, not manifestly constant evaluated) because it is > called in initializer of a variable, but the outer one isn't, and when it > isn't, define_static_array is called with non-constant argument and as it is > consteval itself, calling it that way is invalid C++. > You really want to use consteval keywords on lambdas like that. I think it isn't correct behavior, because it behaves diffrenet when only change 'struct S' into 'const char *'. I use lambda or no consteval keywords, just because I'm lazy.
