aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/conditional-expr.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-02-19 00:13:59 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-02-19 00:13:59 +0000
commit7ef932429ed0edcc5e4bf44e516f5f4be6a8a03f (patch)
tree0b40685b3a7d43fb4cf686bc3d8f59a2a1fd2279 /test/SemaCXX/conditional-expr.cpp
parent0a8709a4744f6a80a006edf78b27597d9232ee30 (diff)
Fix a missed case in the NULL operand to conditional operator
diagnostics. Patch by Stephen Hines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r--test/SemaCXX/conditional-expr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp
index 3881765cff..5637ed14c0 100644
--- a/test/SemaCXX/conditional-expr.cpp
+++ b/test/SemaCXX/conditional-expr.cpp
@@ -311,10 +311,12 @@ namespace PR7598 {
namespace PR9236 {
#define NULL 0L
void f() {
+ int i;
(void)(true ? A() : NULL); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
(void)(true ? NULL : A()); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
(void)(true ? 0 : A()); // expected-error{{incompatible operand types}}
(void)(true ? nullptr : A()); // expected-error{{non-pointer operand type 'A' incompatible with nullptr}}
+ (void)(true ? nullptr : i); // expected-error{{non-pointer operand type 'int' incompatible with nullptr}}
(void)(true ? __null : A()); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
(void)(true ? (void*)0 : A()); // expected-error{{incompatible operand types}}
}