[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
Fri Feb 19 11:02:40 PST 2016


rnk added a comment.

I think we should do this because MSVC doesn't make _Static_assert available to C code. David says that, according to the C standard, assert.h is supposed to `#define static_assert _Static_assert`. MSVC doesn't do that because they provide static_assert directly as a keyword. Pretty soon we'll start seeing portable C projects including assert.h to use plain `static_assert`, and if we don't do something, that code will compile with MSVC but not clang-cl.

I think we should do this under fms-compatibility, not fms-extensions, because it is technically not a conforming extension. =/ There isn't a bit for that currently, but we should add one. Maybe call it KEYMSCOMPAT?


http://reviews.llvm.org/D17444





More information about the cfe-commits mailing list