mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 10:07:41 +08:00
Revert "Emit an error when mixing <stdatomic.h> and <atomic>"
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
This commit is contained in:
@@ -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)
|
#if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
|
||||||
#error <atomic> is not implemented
|
#error <atomic> is not implemented
|
||||||
#endif
|
#endif
|
||||||
#ifdef __ALLOW_STDC_ATOMICS_IN_CXX__
|
|
||||||
#error <stdatomic.h> is incompatible with the C++ standard library
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if _LIBCPP_STD_VER > 14
|
#if _LIBCPP_STD_VER > 14
|
||||||
# define __cpp_lib_atomic_is_always_lock_free 201603L
|
# define __cpp_lib_atomic_is_always_lock_free 201603L
|
||||||
|
@@ -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
|
|
||||||
//
|
|
||||||
// <atomic>
|
|
||||||
|
|
||||||
// Test that including <atomic> 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 <atomic>
|
|
||||||
// expected-error@atomic:* {{<stdatomic.h> is incompatible with the C++ standard library}}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
Reference in New Issue
Block a user