aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/nullptr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-14 22:35:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-14 22:35:28 +0000
commit26f2cac83eeb4317738d74b9e567d3d58aa04ed9 (patch)
treedb514805ff48e91bd6aced379235297f345770a9 /test/SemaCXX/nullptr.cpp
parentc6889e7ed16604c51994e1f11becf213fdc64eb3 (diff)
constexpr: evaluation support for nullptr comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/nullptr.cpp')
-rw-r--r--test/SemaCXX/nullptr.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/SemaCXX/nullptr.cpp b/test/SemaCXX/nullptr.cpp
index 0e6771b57f..91757cf51e 100644
--- a/test/SemaCXX/nullptr.cpp
+++ b/test/SemaCXX/nullptr.cpp
@@ -113,15 +113,26 @@ 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];
-// FIXME: when we implement constexpr, this will be testable.
-#if 0
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];
-#endif
+
+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];
namespace overloading {
int &f1(int*);