From a382216407036b10a5429441e101823a776f8caa Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Tue, 8 May 2018 22:50:35 +0000 Subject: [PATCH] Revert "Emit an error when mixing and " It reverts commit r331379 because turned out `__ALLOW_STDC_ATOMICS_IN_CXX__` doesn't work well in practice. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331818 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/atomic | 3 --- test/libcxx/atomics/c_compatibility.fail.cpp | 28 -------------------- 2 files changed, 31 deletions(-) delete mode 100644 test/libcxx/atomics/c_compatibility.fail.cpp diff --git a/include/atomic b/include/atomic index adffc354a..34a2a58b2 100644 --- a/include/atomic +++ b/include/atomic @@ -555,9 +555,6 @@ 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 __ALLOW_STDC_ATOMICS_IN_CXX__ -#error is incompatible with the C++ standard library -#endif #if _LIBCPP_STD_VER > 14 # define __cpp_lib_atomic_is_always_lock_free 201603L diff --git a/test/libcxx/atomics/c_compatibility.fail.cpp b/test/libcxx/atomics/c_compatibility.fail.cpp deleted file mode 100644 index 092687d5b..000000000 --- a/test/libcxx/atomics/c_compatibility.fail.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads -// -// - -// Test that including fails to compile when we want to use C atomics -// in C++ and have corresponding macro defined. - -// MODULES_DEFINES: __ALLOW_STDC_ATOMICS_IN_CXX__ -#ifndef __ALLOW_STDC_ATOMICS_IN_CXX__ -#define __ALLOW_STDC_ATOMICS_IN_CXX__ -#endif - -#include -// expected-error@atomic:* {{ is incompatible with the C++ standard library}} - -int main() -{ -} -