summaryrefslogtreecommitdiff
path: root/test/SemaCXX/member-pointer.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
commit180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 (patch)
tree2097d084eb235c0b12c0bff3445f4ec7bbaa8a12 /test/SemaCXX/member-pointer.cpp
parent29cafa66ad3878dbb9f82615f19fa0bded2e443c (diff)
Diffstat (limited to 'test/SemaCXX/member-pointer.cpp')
-rw-r--r--test/SemaCXX/member-pointer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/member-pointer.cpp b/test/SemaCXX/member-pointer.cpp
index de3b211acf500..cf6481015a823 100644
--- a/test/SemaCXX/member-pointer.cpp
+++ b/test/SemaCXX/member-pointer.cpp
@@ -296,3 +296,19 @@ namespace PR9973 {
mem_fn(&test::nullary_v)(t); // expected-note{{in instantiation of}}
}
}
+
+namespace test8 {
+ struct A { int foo; };
+ int test1() {
+ // Verify that we perform (and check) an lvalue conversion on the operands here.
+ return (*((A**) 0)) // expected-warning {{indirection of non-volatile null pointer will be deleted}} expected-note {{consider}}
+ ->**(int A::**) 0; // expected-warning {{indirection of non-volatile null pointer will be deleted}} expected-note {{consider}}
+ }
+
+ int test2() {
+ // Verify that we perform (and check) an lvalue conversion on the operands here.
+ // TODO: the .* should itself warn about being a dereference of null.
+ return (*((A*) 0))
+ .**(int A::**) 0; // expected-warning {{indirection of non-volatile null pointer will be deleted}} expected-note {{consider}}
+ }
+}