[PATCH] D50792: [ASTImporter] Add test for member pointer types.

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 11:10:07 PDT 2018


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;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50792.160860.patch
Type: text/x-patch
Size: 817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180815/9060f0fd/attachment-0001.bin>


More information about the cfe-commits mailing list