From 31560015df8c3349daa368d25ea86cbf4bae4aeb Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 2024 16:41:17 +0100 Subject: [PATCH] Make test work back up to Clang 3 --- clang/test/CXX/drs/cwg7xx.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/clang/test/CXX/drs/cwg7xx.cpp b/clang/test/CXX/drs/cwg7xx.cpp index 1e5d3c0873d8b3..c603b5a9614e33 100644 --- a/clang/test/CXX/drs/cwg7xx.cpp +++ b/clang/test/CXX/drs/cwg7xx.cpp @@ -77,13 +77,22 @@ namespace cwg712 { // cwg712: partial } namespace cwg713 { // cwg713: yes -static_assert(!__is_const(void()const), ""); -static_assert(!__is_const(void()const volatile), ""); -static_assert(!__is_volatile(void()volatile), ""); -static_assert(!__is_volatile(void()const volatile), ""); +template +struct is_const { + static const bool value = __is_const(T); +}; +template +struct is_volatile { + static const bool value = __is_volatile(T); +}; + +static_assert(!is_const::value, ""); +static_assert(!is_const::value, ""); +static_assert(!is_volatile::value, ""); +static_assert(!is_volatile::value, ""); #if __cplusplus >= 201103L -static_assert(!__is_const(void()const&), ""); -static_assert(!__is_volatile(void()volatile&), ""); +static_assert(!is_const::value, ""); +static_assert(!is_volatile::value, ""); #endif } // namespace cwg713