diff --git a/include/__config b/include/__config index 73e653c1..a11dbc96 100644 --- a/include/__config +++ b/include/__config @@ -591,9 +591,11 @@ typedef unsigned int char32_t; #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT +extern "C++" { template struct __static_assert_test; template <> struct __static_assert_test {}; template struct __static_assert_check {}; +} #define static_assert(__b, __m) \ typedef __static_assert_check)> \ _LIBCPP_CONCAT(__t, __LINE__) diff --git a/test/std/depr/depr.c.headers/extern_c.pass.cpp b/test/std/depr/depr.c.headers/extern_c.pass.cpp new file mode 100644 index 00000000..d4d8b5fa --- /dev/null +++ b/test/std/depr/depr.c.headers/extern_c.pass.cpp @@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Sometimes C++'s headers get included within extern "C" contexts. This +// is ill-formed (no diagnostic required), per [using.headers]p3, but we permit +// it as an extension. + +extern "C" { +#include +// complex.h is not supported in extern "C". +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// tgmath.h is not supported in extern "C". +#include +// FIXME: #include +#include +#include +} + +int main() {}