aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/__null.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/__null.cpp')
-rw-r--r--test/SemaCXX/__null.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/__null.cpp b/test/SemaCXX/__null.cpp
index 3583655134a7..1989a45fb5f2 100644
--- a/test/SemaCXX/__null.cpp
+++ b/test/SemaCXX/__null.cpp
@@ -12,3 +12,10 @@ void f() {
// Verify that null is evaluated as 0.
int b[__null ? -1 : 1];
}
+
+struct A {};
+
+void g() {
+ (void)(0 ? __null : A()); // expected-error {{non-pointer operand type 'A' incompatible with NULL}}
+ (void)(0 ? A(): __null); // expected-error {{non-pointer operand type 'A' incompatible with NULL}}
+}