Skip to content

Commit 74450be

Browse files
[Interop][SwiftToCxx] Moving the max function to _impl namespace and assigning swift-expected-execution.cpp as unsupported by Windows.
1 parent 6d16962 commit 74450be

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/PrintAsClang/_SwiftCxxInteroperability.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ constexpr static std::size_t max(std::size_t a, std::size_t b) {
199199
return a > b ? a : b;
200200
}
201201

202+
} // namespace _impl
203+
202204
/// The Expected class has either an error or an value.
203205
template<class T>
204206
class Expected {
@@ -302,7 +304,7 @@ class Expected {
302304
constexpr bool has_value() const noexcept { return has_val; }
303305

304306
private:
305-
alignas(max(alignof(T), alignof(swift::Error))) char buffer[max(sizeof(T), sizeof(swift::Error))];
307+
alignas(_impl::max(alignof(T), alignof(swift::Error))) char buffer[_impl::max(sizeof(T), sizeof(swift::Error))];
306308
bool has_val;
307309
};
308310

test/Interop/SwiftToCxx/functions/swift-expected-execution.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// RUN: %target-run %t/swift-expected-execution | %FileCheck %s
1010

1111
// REQUIRES: executable_test
12+
// UNSUPPORTED: OS=windows-msvc
1213

1314
#include <cstdio>
1415
#include "functions.h"

0 commit comments

Comments
 (0)