https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107104
Bug ID: 107104 Summary: semantics of __builtin_constant_p within static_assert and return value Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: me at inclyc dot cn Target Milestone: --- https://godbolt.org/z/oz4e7bobT https://godbolt.org/z/hE6x9G49q illustrate different occasions about this issue. Consider passing the same operand __builtin_constant_p in static assertions and return value, expression with in static assertion passed, but the same expression evaluates to 0 as the return value. Are there some different scopes / contexts that causes different result? Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91158 Link: https://github.com/llvm/llvm-project/issues/58078