diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-10-13 23:12:22 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-10-13 23:12:22 +0000 |
| commit | f157e47fb81d4d70f018e692f28e62ca6a65c320 (patch) | |
| tree | e775e9930362e5fd1adb1b482164da72bd2dae1e /libcxx/include | |
| parent | 658beb930e5b637253fe6b2aa071a830ec0431e1 (diff) | |
| download | bcm5719-llvm-f157e47fb81d4d70f018e692f28e62ca6a65c320.tar.gz bcm5719-llvm-f157e47fb81d4d70f018e692f28e62ca6a65c320.zip | |
Fix use of libc++ <foo.h> headers from within an 'extern "C"' context in C++98.
Previously, this resulted in us declaring a template for static_assert emulation within the 'extern "C"' context, which is ill-formed.
llvm-svn: 250247
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/__config | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 73e653c1990..a11dbc96dfe 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -591,9 +591,11 @@ typedef unsigned int char32_t; #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT +extern "C++" { template <bool> struct __static_assert_test; template <> struct __static_assert_test<true> {}; template <unsigned> struct __static_assert_check {}; +} #define static_assert(__b, __m) \ typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ _LIBCPP_CONCAT(__t, __LINE__) |

