diff options
author | Volodymyr Sapsai <vsapsai@apple.com> | 2017-09-15 00:08:37 +0000 |
---|---|---|
committer | Volodymyr Sapsai <vsapsai@apple.com> | 2017-09-15 00:08:37 +0000 |
commit | 4d9d425d739b556339e6aa7006754bc5e0459b2b (patch) | |
tree | 4d21ee1bcc5408248481339cc069a713ad699190 /runtime | |
parent | 11269d31847e07edf14db760e5e940f394ce595d (diff) | |
download | clang-4d9d425d739b556339e6aa7006754bc5e0459b2b.tar.gz |
[Sema] Correct typos in LHS, RHS before building a binop expression.
Specifically, typo correction should be done before dispatching between
different kinds of binary operations like pseudo-object assignment,
overloaded binary operation, etc.
Without this change we hit an assertion
Assertion failed: (!LHSExpr->hasPlaceholderType(BuiltinType::PseudoObject)), function CheckAssignmentOperands
when in Objective-C we reference a property without `self` and there are
2 equally good typo correction candidates: ivar and a class name. In
this case LHS expression in `BuildBinOp` is
CXXDependentScopeMemberExpr
`-TypoExpr
and instead of handling Obj-C property assignment as pseudo-object
assignment, we call `CreateBuiltinBinOp` which corrects typo to
ObjCPropertyRefExpr '<pseudo-object type>'
but cannot handle pseudo-objects and asserts about it (indirectly,
through `CheckAssignmentOperands`).
rdar://problem/33102722
Reviewers: rsmith, ahatanak, majnemer
Reviewed By: ahatanak
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D37322
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime')
0 files changed, 0 insertions, 0 deletions