diff options
Diffstat (limited to 'test/SemaCXX/nullptr.cpp')
-rw-r--r-- | test/SemaCXX/nullptr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/SemaCXX/nullptr.cpp b/test/SemaCXX/nullptr.cpp index e313603..d148f76 100644 --- a/test/SemaCXX/nullptr.cpp +++ b/test/SemaCXX/nullptr.cpp @@ -33,8 +33,10 @@ nullptr_t f(nullptr_t null) // Operators (void)(null == nullptr); (void)(null <= nullptr); + (void)(null == 0); (void)(null == (void*)0); (void)((void*)0 == nullptr); + (void)(null <= 0); (void)(null <= (void*)0); (void)((void*)0 <= nullptr); (void)(0 == nullptr); @@ -44,7 +46,7 @@ nullptr_t f(nullptr_t null) (void)(1 > nullptr); // expected-error {{invalid operands to binary expression}} (void)(1 != nullptr); // expected-error {{invalid operands to binary expression}} (void)(1 + nullptr); // expected-error {{invalid operands to binary expression}} - (void)(0 ? nullptr : 0); // expected-error {{non-pointer operand type 'int' incompatible with nullptr}} + (void)(0 ? nullptr : 0); (void)(0 ? nullptr : (void*)0); (void)(0 ? nullptr : A()); // expected-error {{non-pointer operand type 'A' incompatible with nullptr}} (void)(0 ? A() : nullptr); // expected-error {{non-pointer operand type 'A' incompatible with nullptr}} |