[clang] [Clang] Implement P2843R3 - Preprocessing is never undefined (PR #192073)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 16 08:47:00 PDT 2026
ilovepi wrote:
Hi, I think we're seeing this fail in our CI when building libcxx with clang-cl against the windows SDK. We see this in our windows, linux and mac builders across both x86_64 and Aarch64. We've been using this version of the SDK for quite a while, and AFAIK its still widely used and supported. Would you mind taking a look? Maybe there's some missing compatibility checks clang is missing to use the new behavior?
Bot: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8684352140261155233/overview
Logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8684352140261155233/+/u/clang/build/stdout
Error:
```console
FAILED: libcxx/src/CMakeFiles/cxx_static.dir/system_error.cpp.obj
/b/s/w/ir/x/w/llvm_build/./bin/clang-cl --target=x86_64-pc-windows-msvc /nologo -TP -DLIBC_NAMESPACE=__llvm_libc_common_utils -DUNICODE -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ALLOW_MSC_VER_MISMATCH -D_CRTBLD -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -D_GLIBCXX_ASSERTIONS -D_LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION=2 -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS="" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src -I/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -I/b/s/w/ir/x/w/llvm_build/include/c++/v1 -I/b/s/w/ir/x/w/llvm-llvm-project/cmake/Modules/../../libc -Xclang -ivfsoverlay -Xclang /b/s/w/ir/cache/windows_sdk/llvm-vfsoverlay.yaml /winsysroot /b/s/w/ir/cache/windows_sdk /Zc:inline /Zc:__cplusplus /Oi /bigobj /permissive- -Werror=unguarded-availability-new /W4 -wd4146 -wd4244 -wd4267 -wd4456 -wd4457 -wd4458 -wd4459 -wd4624 -wd4100 -wd4127 -wd4505 -wd4702 -wd4245 -wd4310 -wd4701 -wd4703 -wd4389 -wd4805 -wd4577 -wd4319 -wd4324 -wd4251 -wd4275 -w14062 -we4238 /Gw -Xclang -fno-pch-timestamp /O2 /Ob1 -std:c++17 -MD -Zi -UNDEBUG /std:c++latest -W4 -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wzero-length-array -Wdeprecated-redundant-constexpr-static-def -Wno-nullability-completeness -Wmissing-prototypes -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-compat -Wno-undef -Wno-reserved-id-macro -Wno-gnu-include-next -Wno-gcc-compat -Wno-zero-as-null-pointer-constant -Wno-deprecated-dynamic-exception-spec -Wno-sign-conversion -Wno-old-style-cast -Wno-deprecated -Wno-shift-sign-overflow -Wno-double-promotion -Wno-error -EHsc /showIncludes /Folibcxx/src/CMakeFiles/cxx_static.dir/system_error.cpp.obj /Fdlibcxx/src/CMakeFiles/cxx_static.dir/cxx_static.pdb -c -- /b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/system_error.cpp
In file included from /b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/system_error.cpp:25:
In file included from /b/s/w/ir/cache/windows_sdk/Windows Kits/10/Include/10.0.19041.0/um/Windows.h:172:
/b/s/w/ir/cache/windows_sdk/Windows Kits/10/Include/10.0.19041.0/um/WinBase.h(9531,5): error: macro expansion producing 'defined' is not allowed
9531 | #if MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS /* { */
| ^
/b/s/w/ir/cache/windows_sdk/Windows Kits/10/Include/10.0.19041.0/um/WinBase.h(9528,104): note: expanded from macro 'MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS'
9528 | #define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS (_WIN32_WINNT >= 0x0502 || !defined(_WINBASE_))
| ^
1 error generated.
```
https://github.com/llvm/llvm-project/pull/192073
More information about the cfe-commits
mailing list