[libcxx] r331818 - Revert "Emit an error when mixing <stdatomic.h> and <atomic>"

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Tue May 8 15:50:36 PDT 2018


Author: vsapsai
Date: Tue May  8 15:50:35 2018
New Revision: 331818

URL: http://llvm.org/viewvc/llvm-project?rev=331818&view=rev
Log:
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.

Removed:
    libcxx/trunk/test/libcxx/atomics/c_compatibility.fail.cpp
Modified:
    libcxx/trunk/include/atomic

Modified: libcxx/trunk/include/atomic
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?rev=331818&r1=331817&r2=331818&view=diff
==============================================================================
--- libcxx/trunk/include/atomic (original)
+++ libcxx/trunk/include/atomic Tue May  8 15:50:35 2018
@@ -555,9 +555,6 @@ void atomic_signal_fence(memory_order m)
 #if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
 #error <atomic> is not implemented
 #endif
-#ifdef __ALLOW_STDC_ATOMICS_IN_CXX__
-#error <stdatomic.h> is incompatible with the C++ standard library
-#endif
 
 #if _LIBCPP_STD_VER > 14
 # define __cpp_lib_atomic_is_always_lock_free 201603L

Removed: libcxx/trunk/test/libcxx/atomics/c_compatibility.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/atomics/c_compatibility.fail.cpp?rev=331817&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/atomics/c_compatibility.fail.cpp (original)
+++ libcxx/trunk/test/libcxx/atomics/c_compatibility.fail.cpp (removed)
@@ -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 at atomic:* {{<stdatomic.h> is incompatible with the C++ standard library}}
-
-int main()
-{
-}
-




More information about the cfe-commits mailing list