diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
| commit | 56d91b49b13fe55c918afbda19f6165b5fbff87a (patch) | |
| tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/SemaCXX/nullptr.cpp | |
| parent | 41e20f564abdb05101d6b2b29c59459a966c22cc (diff) | |
Notes
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 e3136039f425b..d148f76698ec4 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}} |
