diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 11 |
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, |

