https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #12 from Jonathan Wakely ---
Well this request is satisfied by std::is_constant_evaluated() in C++20, which
is what __builtin_is_constant_evaluated() exists for. PR 100974 adds a newer
C++23 language feature that makes std::is_constan
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
Markus Trippelsdorf changed:
What|Removed |Added
CC||trippels at gcc dot gnu.org
--- Co
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #9 from Eric Fiselier ---
I think it would be nice to be able to dispatch differently depending on being
called at compile time or runtime. However the ability to dispatch on that
condition doesn't have to be usable in "if constexpr".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #8 from gnzlbg ---
Eric your concerns and suggestions make sense. Changing the signature of the
functions using something like __ctfe__ and probably anything that would use
those sounds like a major ABI breaking change though. I do no
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
Eric Fiselier changed:
What|Removed |Added
CC||eric at efcs dot ca
--- Comment #7 from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #6 from gnzlbg ---
> I wasn't replying to the part about function aliases, I was replying to the
> part about having the built-in work even when used in a non-constexpr
> function. It sounds like what you're suggesting would depend
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #5 from Andrew Pinski ---
What about __builtin_constant_expression.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #4 from Jonathan Wakely ---
(In reply to gnzlbg from comment #2)
> if constexpr() { // Error: expression missing in if condition
Oh, I didn't realise you meant without an expression. Yeah that doesn't work.
> > That sounds like a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #3 from gnzlbg ---
I guess I should have written, "How does this feature make ODR violations more
common than the inline keyword?". Which new perils does it introduce?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #2 from gnzlbg ---
> It's already in C++17 and supported by GCC.
The following program is ill-formed in C++17:
int main() {
if constexpr() { // Error: expression missing in if condition
return 1;
}
return 0;
}
> That s
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
Jonathan Wakely changed:
What|Removed |Added
Severity|normal |enhancement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79452
--- Comment #1 from Jonathan Wakely ---
(In reply to gnzlbg from comment #0)
> Implementation as a builtin is preferred, because it is possible that "if
> constexpr() { }" syntax will be proposed for standardization.
It's already in C++17 and su
13 matches
Mail list logo