Page MenuHomePhabricator

[libc++] Make feature-test macros consistent with availability macros
ClosedPublic

Authored by ldionne on Jan 19 2021, 10:24 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rG76fc35752d19: [libc++] Make feature-test macros consistent with availability macros
Summary

Before this patch, feature-test macros didn't take special availability
markup into account, which means that feature-test macros can sometimes
appear to "lie". For example, if you compile in C++20 mode and target
macOS 10.13, the __cpp_lib_filesystem feature-test macro will be provided
even though the <filesystem> declarations are marked as unavailable.
This patch fixes that.

rdar://68142369

Diff Detail

Unit TestsFailed

TimeTest
450 mslibcxx CI Apple back-deployment macosx10.15 > libc++.std/language_support/support_limits/support_limits_general::atomic.version.pass.cpp
Script: -- : 'COMPILED WITH'; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ /private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.pass.cpp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -v --target=x86_64-apple-macosx10.15 -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/__config_site -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/include -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/include/c++build -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2a -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/test/std/language.support/support.limits/support.limits.general/Output/atomic.version.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -L/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/./lib -Wl,-rpath,/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/macos-roots/macOS/libc++/10.15 -L/private/tmp/buildkite-builds/mbp-2-local-1/llvm…
820 mslibcxx CI Apple back-deployment macosx10.15 > libc++.std/language_support/support_limits/support_limits_general::barrier.version.pass.cpp
Script: -- : 'COMPILED WITH'; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ /private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.pass.cpp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -v --target=x86_64-apple-macosx10.15 -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/__config_site -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/include -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/include/c++build -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2a -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/test/std/language.support/support.limits/support.limits.general/Output/barrier.version.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -L/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/./lib -Wl,-rpath,/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/macos-roots/macOS/libc++/10.15 -L/private/tmp/buildkite-builds/mbp-2-local-1/llvm…
520 mslibcxx CI Apple back-deployment macosx10.15 > libc++.std/language_support/support_limits/support_limits_general::latch.version.pass.cpp
Script: -- : 'COMPILED WITH'; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ /private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.pass.cpp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -v --target=x86_64-apple-macosx10.15 -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/__config_site -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/include -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/include/c++build -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2a -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/test/std/language.support/support.limits/support.limits.general/Output/latch.version.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -L/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/./lib -Wl,-rpath,/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/macos-roots/macOS/libc++/10.15 -L/private/tmp/buildkite-builds/mbp-2-local-1/llvm…
540 mslibcxx CI Apple back-deployment macosx10.15 > libc++.std/language_support/support_limits/support_limits_general::semaphore.version.pass.cpp
Script: -- : 'COMPILED WITH'; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ /private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.pass.cpp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -v --target=x86_64-apple-macosx10.15 -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/__config_site -include /tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/include -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/include/c++build -I/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2a -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/projects/libcxx/test/std/language.support/support.limits/support.limits.general/Output/semaphore.version.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -L/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/./lib -Wl,-rpath,/private/tmp/buildkite-builds/mbp-2-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.15/macos-roots/macOS/libc++/10.15 -L/private/tmp/buildkite-builds/mbp-2-local-1/llvm…
370 mslibcxx CI Apple back-deployment macosx10.9 > libc++.std/language_support/support_limits/support_limits_general::atomic.version.pass.cpp
Script: -- : 'COMPILED WITH'; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ /private/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.pass.cpp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -v --target=x86_64-apple-macosx10.9 -include /tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.9/projects/libcxx/__config_site -include /tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/libcxx/include -I/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.9/projects/libcxx/include/c++build -I/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2a -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/private/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.9/projects/libcxx/test/std/language.support/support.limits/support.limits.general/Output/atomic.version.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -L/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx-ci/build/x86_64-apple-system-backdeployment-10.9/./lib -Wl,-rpath,/private/tmp/buildkite-agent/builds/libcxx-mbp-local-1/llvm-project/libcxx…
View Full Test Results (9 Failed)

Event Timeline

ldionne created this revision.Jan 19 2021, 10:24 AM
ldionne requested review of this revision.Jan 19 2021, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 10:24 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne updated this revision to Diff 317620.Jan 19 2021, 10:25 AM

Fix typo.

Note that I expect to have to make changes to the tests. I'm submitting a patch mainly to run the CI.

ldionne updated this revision to Diff 317621.Jan 19 2021, 10:26 AM

Re-generate feature-test macros after fixing the typo.

ldionne updated this revision to Diff 321182.Feb 3 2021, 12:02 PM

Rebase onto main and try to fix failing tests.

ldionne accepted this revision as: Restricted Project.Feb 4 2021, 8:40 AM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 4 2021, 8:40 AM
This revision was automatically updated to reflect the committed changes.