[PATCH] D17444: PR26672: [MSVC] Clang does not recognize "static_assert" keyword in C mode

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 24 08:49:22 PDT 2016


On Thu, Mar 3, 2016 at 10:40 AM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> That was what I meant by "justification". I would say it has to be
> reasonably compelling code (win32 headers, boost, some other major
> library) as that's our usual bar for these sort of bug-for-bug
> compatible things, as I understand it.


I'd rather apply this patch now than wait for ffmpeg or someone to try to
use static_assert and then have to hustle to get this into clang. Many many
C projects have COMPILE_ASSERT macros that are just a small change away
from relying on (_S|s)tatic_assert.


> Agreed, we have a way forward if we need it. I mostly just want to
> avoid the burden of supporting that because this is sufficiently weird
> (being a non-conforming keyword).
>

It's not conforming, but it's not that weird to define our own keywords.
The C++ committee chose the keyword "static_assert" because it was unlikely
to conflict with existing code. MSVC has made this a keyword in C mode and
the world hasn't burned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160324/1560b8e5/attachment.html>


More information about the cfe-commits mailing list