================
@@ -5,6 +5,17 @@
 // RUN: %clang_cc1 -std=c++11 
-verify=expected,cxx98-14,cxx98-17,cxx98-20,cxx11-14,since-cxx11 -triple 
%itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++98 
-verify=expected,cxx98-14,cxx98-17,cxx98-20,cxx98 -triple %itanium_abi_triple 
%s -fexceptions -fcxx-exceptions -pedantic-errors
 
+#if __cplusplus == 199711L
+#define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
+// cxx98-error@-1 {{variadic macros are a C99 feature}}
+#endif
+
+#if __cplusplus == 199711L
+#define __enable_constant_folding(x) (__builtin_constant_p(x) ? (x) : (x))
+#else
+#define __enable_constant_folding
+#endif
----------------
Sirraide wrote:

I don’t think we normally do that too often for tests, but this is the third 
file or so that I’ve seen so far that uses these macros, so I’d maybe suggest 
moving them into a header that the tests can include (especially considering 
you said you’re going to refactor more tests than just these) if that doesn’t 
cause any problems.

https://github.com/llvm/llvm-project/pull/88611
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to