https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112296
--- Comment #3 from Jonathan Wakely ---
(In reply to Barry Revzin from comment #0)
> inline int direct(Span span) {
> return __builtin_constant_p(span.size());
> }
>
> inline int indirect(Span span) {
> size_t s = span.size();
> ret
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112296
--- Comment #2 from Jonathan Wakely ---
I think you mean std::is_constant_evaluated, but that doesn't check values, it
checks if the function is being evaluated as constexpr. And if-constexpr can't
be used here either, that works like templates,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112296
--- Comment #1 from Richard Biener ---
__builtin_constant_p is limited by inlining, maybe you want to use
if constexpr for this or the standard library facility I can't remember
right now.