This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/85182] _Static_assert is less than useful in a static inline
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Apr 2018 21:43:51 +0000
- Subject: [Bug c/85182] _Static_assert is less than useful in a static inline
- Auto-submitted: auto-generated
- References: <bug-85182-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85182
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
This is how static assertions are defined in C11, not a bug in GCC: it's a
constraint violation if the constant expression compares equal to 0,
regardless of the context in which the declaration appears (thus, a
constraint violation in a function that is never called, for example).