mirror of https://github.com/microsoft/clang.git
[ASTImporter] Add test for member pointer types.
Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50792 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
557c56b21e
commit
5bdeac6e50
|
@ -0,0 +1,7 @@
|
|||
struct S {
|
||||
int i;
|
||||
};
|
||||
|
||||
int S::*iptr() {
|
||||
return &S::i;
|
||||
}
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue