summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 56ad9b42410..e2a6d346164 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -7097,8 +7097,15 @@ void Sema::ConvertPropertyForRValue(Expr *&E) {
ExprValueKind VK = VK_RValue;
if (PRE->isImplicitProperty()) {
- QualType Result = PRE->getImplicitPropertyGetter()->getResultType();
- VK = Expr::getValueKindForType(Result);
+ if (const ObjCMethodDecl *GetterMethod =
+ PRE->getImplicitPropertyGetter()) {
+ QualType Result = GetterMethod->getResultType();
+ VK = Expr::getValueKindForType(Result);
+ }
+ else {
+ Diag(PRE->getLocation(), diag::err_getter_not_found)
+ << PRE->getBase()->getType();
+ }
}
E = ImplicitCastExpr::Create(Context, E->getType(), CK_GetObjCProperty,
OpenPOWER on IntegriCloud