Headers: further refine the `stdatomic.h` MSVC inclusion
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 21 Dec 2022 16:45:28 +0000 (16:45 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 21 Dec 2022 19:09:10 +0000 (19:09 +0000)
commit6c3a2902f1f8d102aa5b3cd37def4f1420ac0c80
treec0f851d9a910768cb91dde06fd8fb5b41e741d05
parentc847e22db33e4625b1ad58b631f57d7d1e1944ca
Headers: further refine the `stdatomic.h` MSVC inclusion

The `stdatomic.h` header cannot be included under MSVC when in C++ mode
as the toolsets prior to 17.5.0 Preview 2 do not support the C11
atomics.  However, some toolsets prior to the aforementioned version
support the atomics under the C++ mode.  In these versions the MSVC
toolset protects against the contamination by entirely eliding the
declarations, resulting in build failures in some cases.  Unfortunately,
e0c3142af075e2ef89395dbed5939071345eb622 accidentally regressed the C
case when fixing the C++ support.

Unfortunately, we cannot test this reliably as we need to inject a
header after the resource path as a system header path, which we do not
have a reliable means of doing.

Fixes: #59640
clang/lib/Headers/stdatomic.h