teemperor created this revision.
Herald added a subscriber: martong.
Herald added a reviewer: a.sidorin.

Repository:
  rC Clang

https://reviews.llvm.org/D50792

Files:
  test/Import/cxx-member-pointers/Inputs/S.cpp
  test/Import/cxx-member-pointers/test.cpp


Index: test/Import/cxx-member-pointers/test.cpp
===================================================================
--- /dev/null
+++ test/Import/cxx-member-pointers/test.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | 
FileCheck %s
+
+// CHECK: VarDecl
+// CHECK-SAME: int S::*
+// CHECK-NEXT: CallExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: int S::*(*)()
+// CHECK-NEXT: DeclRefExpr
+// CHECK-SAME: int S::*()
+
+void expr() {
+  int S::*p = iptr();
+  S s;
+  s.i = 3;
+  int i = s.*p;
+}
Index: test/Import/cxx-member-pointers/Inputs/S.cpp
===================================================================
--- /dev/null
+++ test/Import/cxx-member-pointers/Inputs/S.cpp
@@ -0,0 +1,7 @@
+struct S {
+  int i;
+};
+
+int S::*iptr() {
+  return &S::i;
+}


Index: test/Import/cxx-member-pointers/test.cpp
===================================================================
--- /dev/null
+++ test/Import/cxx-member-pointers/test.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | FileCheck %s
+
+// CHECK: VarDecl
+// CHECK-SAME: int S::*
+// CHECK-NEXT: CallExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: int S::*(*)()
+// CHECK-NEXT: DeclRefExpr
+// CHECK-SAME: int S::*()
+
+void expr() {
+  int S::*p = iptr();
+  S s;
+  s.i = 3;
+  int i = s.*p;
+}
Index: test/Import/cxx-member-pointers/Inputs/S.cpp
===================================================================
--- /dev/null
+++ test/Import/cxx-member-pointers/Inputs/S.cpp
@@ -0,0 +1,7 @@
+struct S {
+  int i;
+};
+
+int S::*iptr() {
+  return &S::i;
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to