[Bug c++/70552] __builtin_constant_p fails to reflect the constness of constexpr calls
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 15 21:52:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70552
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-04-15
Ever confirmed|0 |1
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm going to confirm this report on the basis of others similar to it, such as
bug 19449 which has some interesting background. The patch referenced from it
sets a precedent for the intrinsic treating constant expressions as constant
despite its late evaluation under "normal" circumstances (the
force_folding_builtin_constant_p global variable was put in place to circumvent
this delayed evaluation). cxx_eval_builtin_function_call() in cp/constexpr.c
does set force_folding_builtin_constant_p to true, making it clear that the
intent is for the intrinsic to be evaluated during constexpr evaluation in C++.
Something seems to be interfering with it (I just haven't yet figured out
what).
More information about the Gcc-bugs
mailing list