aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/conditional-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r--test/SemaCXX/conditional-expr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp
index 8ac0a9736a..3881765cff 100644
--- a/test/SemaCXX/conditional-expr.cpp
+++ b/test/SemaCXX/conditional-expr.cpp
@@ -307,3 +307,15 @@ namespace PR7598 {
}
}
+
+namespace PR9236 {
+#define NULL 0L
+ void f() {
+ (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 ? __null : A()); // expected-error{{non-pointer operand type 'A' incompatible with NULL}}
+ (void)(true ? (void*)0 : A()); // expected-error{{incompatible operand types}}
+ }
+}