Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions include/proxy/v4/detail/compatibility_check.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) 2022-2026 Microsoft Corporation.
// Copyright (c) 2026-Present Next Gen C++ Foundation.
// Licensed under the MIT License.

#ifndef MSFT_PROXY_V4_DETAIL_COMPATIBILITY_CHECK_H_
#define MSFT_PROXY_V4_DETAIL_COMPATIBILITY_CHECK_H_

#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 202002L
#error "Proxy requires C++20 or later."
#endif

// clang-cl miscalculates the layout of an empty [[msvc::no_unique_address]]
// member in a base class (llvm/llvm-project#143245), corrupting pro::proxy.
#if __has_cpp_attribute(msvc::no_unique_address)
namespace pro::inline v4::detail::compatibility_check {
struct empty {};
struct base {
[[msvc::no_unique_address]] empty value;
};
struct derived : base {
char dummy;
};
static_assert(sizeof(derived) == sizeof(char),
"[[msvc::no_unique_address]] is broken");
} // namespace pro::inline v4::detail::compatibility_check
#endif

#endif // MSFT_PROXY_V4_DETAIL_COMPATIBILITY_CHECK_H_
11 changes: 6 additions & 5 deletions include/proxy/v4/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
#ifndef MSFT_PROXY_V4_PROXY_H_
#define MSFT_PROXY_V4_PROXY_H_

#include "detail/core.h" // IWYU pragma: export
#include "detail/dispatch.h" // IWYU pragma: export
#include "detail/facade_creation.h" // IWYU pragma: export
#include "detail/proxy_creation.h" // IWYU pragma: export
#include "detail/skills.h" // IWYU pragma: export
#include "detail/compatibility_check.h" // IWYU pragma: keep
#include "detail/core.h" // IWYU pragma: export
#include "detail/dispatch.h" // IWYU pragma: export
#include "detail/facade_creation.h" // IWYU pragma: export
#include "detail/proxy_creation.h" // IWYU pragma: export
#include "detail/skills.h" // IWYU pragma: export

#endif // MSFT_PROXY_V4_PROXY_H_
Loading