File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2119,6 +2119,13 @@ auto TypeChecker::Visitor::check_member_access(MemberExpressionAST* ast)
21192119 auto cv1 = strip_cv (objectType);
21202120
21212121 if (ast->accessOp == TokenKind::T_MINUS_GREATER) {
2122+ if (control ()->is_class_or_union (ast->baseExpression ->type )) {
2123+ // todo: lookup operator-> in the class
2124+ } else {
2125+ (void )ensure_prvalue (ast->baseExpression );
2126+ objectType = ast->baseExpression ->type ;
2127+ }
2128+
21222129 auto pointerType = type_cast<PointerType>(objectType);
21232130 if (!pointerType) return false ;
21242131
Original file line number Diff line number Diff line change 1+ // RUN: %cxx -verify -fcheck -freport-missing-types %s
2+
3+ struct X {
4+ int a[1 ];
5+ };
6+
7+ struct S {
8+ struct X x[2 ];
9+ };
10+
11+ int main () {
12+ struct S s;
13+ return s.x ->a [0 ];
14+ }
You can’t perform that action at this time.
0 commit comments