[clang] 9c9e8b4 - Fix test clang/test/AST/Interp/builtin-functions.cpp for compilers that default to a C++ standard earlier than C++17.
Douglas Yung via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 10 16:21:53 PDT 2023
Author: Douglas Yung
Date: 2023-08-10T16:21:41-07:00
New Revision: 9c9e8b4797a4305d4273c63b0ab4ce84e3a79e7d
URL: https://github.com/llvm/llvm-project/commit/9c9e8b4797a4305d4273c63b0ab4ce84e3a79e7d
DIFF: https://github.com/llvm/llvm-project/commit/9c9e8b4797a4305d4273c63b0ab4ce84e3a79e7d.diff
LOG: Fix test clang/test/AST/Interp/builtin-functions.cpp for compilers that default to a C++ standard earlier than C++17.
Added:
Modified:
clang/test/AST/Interp/builtin-functions.cpp
Removed:
################################################################################
diff --git a/clang/test/AST/Interp/builtin-functions.cpp b/clang/test/AST/Interp/builtin-functions.cpp
index 5b8b2dbf09ce5e..85f10d7594d8c9 100644
--- a/clang/test/AST/Interp/builtin-functions.cpp
+++ b/clang/test/AST/Interp/builtin-functions.cpp
@@ -43,6 +43,9 @@ namespace nan {
/// The current interpreter does not accept this, but it should.
constexpr float NaN2 = __builtin_nans([](){return "0xAE98";}()); // ref-error {{must be initialized by a constant expression}}
+#if __cplusplus < 201703L
+ // expected-error at -2 {{must be initialized by a constant expression}}
+#endif
constexpr double NaN3 = __builtin_nan("foo"); // expected-error {{must be initialized by a constant expression}} \
// ref-error {{must be initialized by a constant expression}}
More information about the cfe-commits
mailing list