diff options
| author | Eric Fiselier <eric@efcs.ca> | 2019-06-18 20:50:25 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2019-06-18 20:50:25 +0000 |
| commit | 5c739665a8721228cf6143fd4ef95870a59f55ae (patch) | |
| tree | 5b7665e7fb32ef27a75678b8aedf2834f6f3e5fe | |
| parent | 64fbefde6eb609899186bd894f612068c15d44aa (diff) | |
| download | bcm5719-llvm-5c739665a8721228cf6143fd4ef95870a59f55ae.tar.gz bcm5719-llvm-5c739665a8721228cf6143fd4ef95870a59f55ae.zip | |
Remove GCC C++03 fallbacks for decltype and static_assert.
This means libc++ no longer needs to write extra braces in
static asserts: Ex `static_assert((is_same_v<T, V>), "msg")`.
llvm-svn: 363738
| -rw-r--r-- | libcxx/include/__config | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index f68baa3e3b9..3efd1a71552 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -413,10 +413,6 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_STRONG_ENUMS #endif -#if !(__has_feature(cxx_decltype)) -#define _LIBCPP_HAS_NO_DECLTYPE -#endif - #if __has_feature(cxx_attributes) # define _LIBCPP_NORETURN [[noreturn]] #else @@ -548,7 +544,6 @@ typedef __char32_t char32_t; #ifndef __GXX_EXPERIMENTAL_CXX0X__ #define _LIBCPP_HAS_NO_CONSTEXPR -#define _LIBCPP_HAS_NO_DECLTYPE #define _LIBCPP_HAS_NO_NULLPTR #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_VARIADICS @@ -853,29 +848,10 @@ typedef unsigned int char32_t; #endif #ifdef _LIBCPP_CXX03_LANG -# if __has_extension(c_static_assert) -# define static_assert(__b, __m) _Static_assert(__b, __m) -# else -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__) -# endif // __has_extension(c_static_assert) +# define static_assert(...) _Static_assert(__VA_ARGS__) +# define decltype(...) __decltype(__VA_ARGS__) #endif // _LIBCPP_CXX03_LANG -#ifdef _LIBCPP_HAS_NO_DECLTYPE -// GCC 4.6 provides __decltype in all standard modes. -# if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || defined(_LIBCPP_COMPILER_GCC) -# define decltype(__x) __decltype(__x) -# else -# define decltype(__x) __typeof__(__x) -# endif -#endif - #ifdef _LIBCPP_HAS_NO_CONSTEXPR # define _LIBCPP_CONSTEXPR #else |

