From 6c03a7a2b36d2cd30deb6139842dba369198bb98 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Tue, 15 May 2018 22:38:31 +0000 Subject: [PATCH] Emit an error when include after C11 defines `kill_dependency` as a macro in . When you include after , the macro clashes with `std::kill_dependency` and causes multiple errors. Explicit error should help in diagnosing those errors. No change for working code that includes before . rdar://problem/27435938 Reviewers: rsmith, EricWF, mclow.lists, jfb Reviewed By: jfb Subscribers: jfb, jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D45470 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332413 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/atomic | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/atomic b/include/atomic index 34a2a58b2..dfca76b16 100644 --- a/include/atomic +++ b/include/atomic @@ -555,6 +555,9 @@ void atomic_signal_fence(memory_order m) noexcept; #if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) #error is not implemented #endif +#ifdef kill_dependency +#error C++ standard library is incompatible with +#endif #if _LIBCPP_STD_VER > 14 # define __cpp_lib_atomic_is_always_lock_free 201603L