diff options
author | Reid Kleckner <rnk@google.com> | 2019-02-15 19:59:45 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-02-15 19:59:45 +0000 |
commit | c1648f2bfdc8cdc72c8304a56b9450a65c182ff9 (patch) | |
tree | 10eaa1a074b399c5f181a9f6ed3497b6ee393f0a /lldb/packages/Python/lldbsuite/test/lang/cpp/exceptions/exceptions.cpp | |
parent | 9c6a9276da2df5604a88cdbade279851950210cb (diff) | |
download | bcm5719-llvm-c1648f2bfdc8cdc72c8304a56b9450a65c182ff9.tar.gz bcm5719-llvm-c1648f2bfdc8cdc72c8304a56b9450a65c182ff9.zip |
[MSVC] Recognize `static_assert` keyword in C and C++98
Summary:
The main effect is that clang now accepts the following conforming C11
code with MSVC headers:
#include <assert.h>
static_assert(1, "true");
This is a non-conforming extension (the keyword is outside the
implementer's namespace), so it is placed under -fms-compatibility
instead of -fms-extensions like most MSVC-specific keyword extensions.
Normally, in C11, the compiler is supposed to provide the _Static_assert
keyword, and assert.h should define static_assert to _Static_assert.
However, that is not what MSVC does, and MSVC doesn't even provide
_Static_assert.
This also has the less important side effect of enabling static_assert
in C++98 mode with -fms-compatibility. It's exceptionally difficult to
use modern MSVC headers without C++14 even, so this is relatively
unimportant.
Fixes PR26672
Patch by Andrey Bokhanko!
Reviewers: rsmith, thakis
Subscribers: cfe-commits, STL_MSFT
Differential Revision: https://reviews.llvm.org/D17444
llvm-svn: 354162
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/exceptions/exceptions.cpp')
0 files changed, 0 insertions, 0 deletions