summaryrefslogtreecommitdiffstats
path: root/clang/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
commit9c9127eacea4d58bf328de90d7da3245a552b9c4 (patch)
treeecfb4845d782535e7b16b00a289f97b4fe691018 /clang/test/SemaCXX/conditional-expr.cpp
parentfc1ad1f3713e65b5c2773341d31a3ae12f9258a7 (diff)
downloadbcm5719-llvm-9c9127eacea4d58bf328de90d7da3245a552b9c4.tar.gz
bcm5719-llvm-9c9127eacea4d58bf328de90d7da3245a552b9c4.zip
Fix a missed case in the NULL operand to conditional operator
diagnostics. Patch by Stephen Hines. llvm-svn: 125998
Diffstat (limited to 'clang/test/SemaCXX/conditional-expr.cpp')
-rw-r--r--clang/test/SemaCXX/conditional-expr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/conditional-expr.cpp b/clang/test/SemaCXX/conditional-expr.cpp
index 3881765cff3..5637ed14c0a 100644
--- a/clang/test/SemaCXX/conditional-expr.cpp
+++ b/clang/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}}
}
OpenPOWER on IntegriCloud