summaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/builtin-ptrtomember-overload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/builtin-ptrtomember-overload.cpp')
-rw-r--r--clang/test/SemaCXX/builtin-ptrtomember-overload.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/builtin-ptrtomember-overload.cpp b/clang/test/SemaCXX/builtin-ptrtomember-overload.cpp
new file mode 100644
index 0000000..c7b5173
--- /dev/null
+++ b/clang/test/SemaCXX/builtin-ptrtomember-overload.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+
+struct A {};
+
+struct B {
+ operator A*();
+};
+
+struct C : B {
+
+};
+
+
+void foo(C c, B b, int A::* pmf) {
+ int j = c->*pmf;
+ int i = b->*pmf;
+}
+
+struct D {
+ operator const D *();
+};
+
+struct DPtr {
+ operator volatile int D::*();
+};
+
+int test(D d, DPtr dptr) {
+ return d->*dptr;
+}
+