[cfe-commits] r150579 - /cfe/trunk/test/SemaCXX/nullptr.cpp
Dmitri Gribenko
gribozavr at gmail.com
Wed Feb 15 05:30:54 PST 2012
Author: gribozavr
Date: Wed Feb 15 07:30:53 2012
New Revision: 150579
URL: http://llvm.org/viewvc/llvm-project?rev=150579&view=rev
Log:
Convert ad-hoc `int array[expr ? -1 : 1]' assertions
in test/SemaCXX/nullptr.cpp to static_assert
Modified:
cfe/trunk/test/SemaCXX/nullptr.cpp
Modified: cfe/trunk/test/SemaCXX/nullptr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/nullptr.cpp?rev=150579&r1=150578&r2=150579&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/nullptr.cpp (original)
+++ cfe/trunk/test/SemaCXX/nullptr.cpp Wed Feb 15 07:30:53 2012
@@ -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];
-
-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];
-
-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];
-
-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(__is_scalar(nullptr_t), "");
+static_assert(__is_pod(nullptr_t), "");
+static_assert(sizeof(nullptr_t) == sizeof(void*), "");
+
+static_assert(!(nullptr < nullptr), "");
+static_assert(!(nullptr > nullptr), "");
+static_assert( nullptr <= nullptr, "");
+static_assert( nullptr >= nullptr, "");
+static_assert( nullptr == nullptr, "");
+static_assert(!(nullptr != nullptr), "");
+
+static_assert(!(0 < nullptr), "");
+static_assert(!(0 > nullptr), "");
+static_assert( 0 <= nullptr, "");
+static_assert( 0 >= nullptr, "");
+static_assert( 0 == nullptr, "");
+static_assert(!(0 != nullptr), "");
+
+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*);
More information about the cfe-commits
mailing list