[clang] [SystemZ] z/OS only accept C initialization (PR #194023)
Sean Perry via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 24 11:50:13 PDT 2026
https://github.com/perry-ca created https://github.com/llvm/llvm-project/pull/194023
The TLS support only accept compile constant expressions (both C and C++) on z/OS. Add #if to skip these tests on z/OS.
>From 146ba07add46163eb78a9874bf08acf4c84b2114 Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Fri, 24 Apr 2026 14:45:54 -0400
Subject: [PATCH] z/OS only accept C initialization
---
clang/test/AST/ByteCode/cxx17.cpp | 2 ++
clang/test/SemaCXX/cxx17-compat.cpp | 2 ++
2 files changed, 4 insertions(+)
diff --git a/clang/test/AST/ByteCode/cxx17.cpp b/clang/test/AST/ByteCode/cxx17.cpp
index 166638b0f5211..5d6e925eab32d 100644
--- a/clang/test/AST/ByteCode/cxx17.cpp
+++ b/clang/test/AST/ByteCode/cxx17.cpp
@@ -174,5 +174,7 @@ template <int I> struct std::tuple_element<I, const C> {
namespace ZeroInCheckInvoke {
constexpr C foo(const C &) { return C{}; }
+#ifndef __MVS__
thread_local const auto &[s, t, u] = foo(C{}); // both-warning {{thread_local}}
+#endif
}
diff --git a/clang/test/SemaCXX/cxx17-compat.cpp b/clang/test/SemaCXX/cxx17-compat.cpp
index 1c9060d388d2a..fdf9b4a1cd55e 100644
--- a/clang/test/SemaCXX/cxx17-compat.cpp
+++ b/clang/test/SemaCXX/cxx17-compat.cpp
@@ -81,6 +81,7 @@ static auto [cx, cy, cz] = C();
// expected-warning at -4 {{structured binding declaration declared 'static' is incompatible with C++ standards before C++20}}
#endif
void f() {
+#ifndef __MVS__
static thread_local auto [cx, cy, cz] = C();
#if __cplusplus <= 201703L
// expected-warning at -2 {{structured binding declaration declared 'static' is a C++20 extension}}
@@ -89,6 +90,7 @@ void f() {
// expected-warning at -5 {{structured binding declaration declared 'static' is incompatible with C++ standards before C++20}}
// expected-warning at -6 {{structured binding declaration declared 'thread_local' is incompatible with C++ standards before C++20}}
#endif
+#endif
}
struct DefaultedComparisons {
More information about the cfe-commits
mailing list