summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-09 22:22:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-09 22:22:48 +0000
commit89009441094ab3930b953ae1198ed120c00be430 (patch)
tree977f326f00c7c73a18415643df5d8a9e5a4c61cf /clang/lib/Sema/SemaExprCXX.cpp
parent7b844849fe098ac600c06740988436e80b5f4d14 (diff)
downloadbcm5719-llvm-89009441094ab3930b953ae1198ed120c00be430.tar.gz
bcm5719-llvm-89009441094ab3930b953ae1198ed120c00be430.zip
Remember to decay arrays to pointers before checking whether the
left-hand side of an -> operator is a pointer to class type. llvm-svn: 360387
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 6af59d5c431..683fc5b3198 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -6790,9 +6790,12 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
FirstIteration = false;
}
- if (OpKind == tok::arrow &&
- (BaseType->isPointerType() || BaseType->isObjCObjectPointerType()))
- BaseType = BaseType->getPointeeType();
+ if (OpKind == tok::arrow) {
+ if (BaseType->isPointerType())
+ BaseType = BaseType->getPointeeType();
+ else if (auto *AT = Context.getAsArrayType(BaseType))
+ BaseType = AT->getElementType();
+ }
}
// Objective-C properties allow "." access on Objective-C pointer types,
OpenPOWER on IntegriCloud