https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113565
Bug ID: 113565 Summary: __builtin_clz(0) is undefined behavior, but not detected in constant expressions Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: janschultke at googlemail dot com Target Milestone: --- Code to reproduce ================= static_assert(__builtin_clz(0)); Actual output (https://godbolt.org/z/v6v5nGxv8) =============================================== None. Expected output (Clang) ======================= <source>:1:15: error: static assertion expression is not an integral constant expression 1 | static_assert(__builtin_clz(0)); | ^~~~~~~~~~~~~~~~