summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/ptrtomember.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/ptrtomember.cpp')
-rw-r--r--clang/test/SemaCXX/ptrtomember.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/ptrtomember.cpp b/clang/test/SemaCXX/ptrtomember.cpp
new file mode 100644
index 00000000000..fb774d85e3e
--- /dev/null
+++ b/clang/test/SemaCXX/ptrtomember.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
+
+struct S {
+ int i;
+
+ int mem(int);
+};
+
+int foo(int S::* ps, S *s)
+{
+ return (s->*ps)(1); // expected-error {{called object type 'int' is not a function or function pointer}}
+}
+
OpenPOWER on IntegriCloud