[libcxx] r282343 - Fix a few static_asserts that need extra parens on -03

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 24 16:52:21 PDT 2016


Author: marshall
Date: Sat Sep 24 18:52:21 2016
New Revision: 282343

URL: http://llvm.org/viewvc/llvm-project?rev=282343&view=rev
Log:
Fix a few static_asserts that need extra parens on -03

Modified:
    libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp
    libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp
    libcxx/trunk/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp

Modified: libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp?rev=282343&r1=282342&r2=282343&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp Sat Sep 24 18:52:21 2016
@@ -27,7 +27,7 @@ void
 test(S s, typename S::size_type pos1, SV sv, typename S::size_type pos2,
      typename S::size_type n, S expected)
 {
-    static_assert(!std::is_same<S, SV>::value, "");
+    static_assert((!std::is_same<S, SV>::value), "");
     typename S::size_type old_size = s.size();
     S s0 = s;
     try
@@ -48,7 +48,7 @@ template <class S, class SV>
 void
 test_npos(S s, typename S::size_type pos1, SV sv, typename S::size_type pos2, S expected)
 {
-    static_assert(!std::is_same<S, SV>::value, "");
+    static_assert((!std::is_same<S, SV>::value), "");
     typename S::size_type old_size = s.size();
     S s0 = s;
     try

Modified: libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp?rev=282343&r1=282342&r2=282343&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp Sat Sep 24 18:52:21 2016
@@ -30,7 +30,7 @@ test(S s, typename S::size_type pos1, ty
      SV sv, typename S::size_type pos2, typename S::size_type n2,
      S expected)
 {
-    static_assert(!std::is_same<S, SV>::value, "");
+    static_assert((!std::is_same<S, SV>::value), "");
     typename S::size_type old_size = s.size();
     S s0 = s;
     try
@@ -56,7 +56,7 @@ test_npos(S s, typename S::size_type pos
           SV sv, typename S::size_type pos2,
           S expected)
 {
-    static_assert(!std::is_same<S, SV>::value, "");
+    static_assert((!std::is_same<S, SV>::value), "");
     typename S::size_type old_size = s.size();
     S s0 = s;
     try

Modified: libcxx/trunk/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp?rev=282343&r1=282342&r2=282343&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp Sat Sep 24 18:52:21 2016
@@ -36,7 +36,7 @@ void
 test(const S& s, typename S::size_type pos1, typename S::size_type n1,
      SV sv,      typename S::size_type pos2, typename S::size_type n2, int x)
 {
-    static_assert(!std::is_same<S, SV>::value, "");
+    static_assert((!std::is_same<S, SV>::value), "");
     try
     {
         assert(sign(s.compare(pos1, n1, sv, pos2, n2)) == sign(x));
@@ -54,7 +54,7 @@ void
 test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
           SV sv,      typename S::size_type pos2, int x)
 {
-    static_assert(!std::is_same<S, SV>::value, "");
+    static_assert((!std::is_same<S, SV>::value), "");
     try
     {
         assert(sign(s.compare(pos1, n1, sv, pos2)) == sign(x));




More information about the cfe-commits mailing list