[PATCH] D21714: [libcxx] [test] In atomics.types.generic/address.pass.cpp, use T(0) for consistency.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 18:33:57 PDT 2016


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

In atomics.types.generic/address.pass.cpp, use T(0) for consistency.

Fixes MSVC "error C2593: 'operator ==' is ambiguous".

There is almost certainly an MSVC compiler bug involved here (which I haven't reduced yet). However, T(0) was used previously in the test, so using it here increases consistency, in addition to making all compilers happy.

http://reviews.llvm.org/D21714

Files:
  test/std/atomics/atomics.types.generic/address.pass.cpp

Index: test/std/atomics/atomics.types.generic/address.pass.cpp
===================================================================
--- test/std/atomics/atomics.types.generic/address.pass.cpp
+++ test/std/atomics/atomics.types.generic/address.pass.cpp
@@ -123,7 +123,7 @@
     {
         _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
         A& zero = *new (storage) A();
-        assert(zero == 0);
+        assert(zero == T(0));
         zero.~A();
     }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21714.61872.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160625/55ee0690/attachment.bin>


More information about the cfe-commits mailing list