Convert ad-hoc `int array[expr ? -1 : 1]' assertions
in test/SemaCXX/nullptr.cpp to static_assert



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150579 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/nullptr.cpp b/test/SemaCXX/nullptr.cpp
index 91757cf..e313603 100644
--- a/test/SemaCXX/nullptr.cpp
+++ b/test/SemaCXX/nullptr.cpp
@@ -109,30 +109,30 @@
   }
 }
 
-int array0[__is_scalar(nullptr_t)? 1 : -1];
-int array1[__is_pod(nullptr_t)? 1 : -1];
-int array2[sizeof(nullptr_t) == sizeof(void*)? 1 : -1];
+static_assert(__is_scalar(nullptr_t), "");
+static_assert(__is_pod(nullptr_t), "");
+static_assert(sizeof(nullptr_t) == sizeof(void*), "");
 
-int relational0[nullptr < nullptr? -1 : 1];
-int relational1[nullptr > nullptr? -1 : 1];
-int relational2[nullptr <= nullptr? 1 : -1];
-int relational3[nullptr >= nullptr? 1 : -1];
-int equality[nullptr == nullptr? 1 : -1];
-int inequality[nullptr != nullptr? -1 : 1];
+static_assert(!(nullptr < nullptr), "");
+static_assert(!(nullptr > nullptr), "");
+static_assert(  nullptr <= nullptr, "");
+static_assert(  nullptr >= nullptr, "");
+static_assert(  nullptr == nullptr, "");
+static_assert(!(nullptr != nullptr), "");
 
-int relational0_a[0 < nullptr? -1 : 1];
-int relational1_a[0 > nullptr? -1 : 1];
-int relational2_a[0 <= nullptr? 1 : -1];
-int relational3_a[0 >= nullptr? 1 : -1];
-int equality_a[0 == nullptr? 1 : -1];
-int inequality_a[0 != nullptr? -1 : 1];
+static_assert(!(0 < nullptr), "");
+static_assert(!(0 > nullptr), "");
+static_assert(  0 <= nullptr, "");
+static_assert(  0 >= nullptr, "");
+static_assert(  0 == nullptr, "");
+static_assert(!(0 != nullptr), "");
 
-int relationalnullptr_b[nullptr < 0? -1 : 1];
-int relational1_b[nullptr > 0? -1 : 1];
-int relational2_b[nullptr <= 0? 1 : -1];
-int relational3_b[nullptr >= 0? 1 : -1];
-int equality_b[nullptr == 0? 1 : -1];
-int inequality_b[nullptr != 0? -1 : 1];
+static_assert(!(nullptr < 0), "");
+static_assert(!(nullptr > 0), "");
+static_assert(  nullptr <= 0, "");
+static_assert(  nullptr >= 0, "");
+static_assert(  nullptr == 0, "");
+static_assert(!(nullptr != 0), "");
 
 namespace overloading {
   int &f1(int*);