This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66963] __builtin_constant_p and __builtin_choose_expr do not agree on what is a constexpr with -O2


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66963

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> I thought this is documented somewhere but __builtin_choose_expr only really
> accept constant literals and not constexprs.

And the main reason is the __builtin_choose_expr chooses the expression before
semantics analysis happens so the first argument needs to be a constant
literal.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]