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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 10:41:07 PST 2019


rnk added a comment.

In D17444#1392823 <https://reviews.llvm.org/D17444#1392823>, @thakis wrote:

> Instead of this patch we could have an assert.h wrapper in lib/Headers that defines static_assert to _Static_assert in ms mode for C files, and I suppose that's a cleaner fix. But I hope it's not controversial that we should try and support standard C programs?


I'd prefer it if we didn't shadow more MSVC CRT headers like assert.h. Users have a long history of holding the compiler wrong, losing these interpositions, and having things not work. If we could just work out the box, users will have less problems, we'll have fewer bug reports, etc, etc. I still think we should follow MSVC and add this is a plain old C++ extension to C under -fms-extensions.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D17444/new/

https://reviews.llvm.org/D17444





More information about the cfe-commits mailing list