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

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 16 11:23:21 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339919: [ASTImporter] Add test for member pointer types. (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D50792?vs=160860&id=161078#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50792

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


Index: cfe/trunk/test/Import/cxx-member-pointers/Inputs/S.cpp
===================================================================
--- cfe/trunk/test/Import/cxx-member-pointers/Inputs/S.cpp
+++ cfe/trunk/test/Import/cxx-member-pointers/Inputs/S.cpp
@@ -0,0 +1,7 @@
+struct S {
+  int i;
+};
+
+int S::*iptr() {
+  return &S::i;
+}
Index: cfe/trunk/test/Import/cxx-member-pointers/test.cpp
===================================================================
--- cfe/trunk/test/Import/cxx-member-pointers/test.cpp
+++ cfe/trunk/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;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50792.161078.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180816/d9846191/attachment.bin>


More information about the cfe-commits mailing list