summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/Scalar.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-12-07 13:17:52 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-12-07 13:17:52 +0000
commit143a9e0b1236d42d12f872eef0cb8fde026db1da (patch)
treeef3c7170f2999a952370a61581edea38656d1aac /llvm/lib/Transforms/Scalar/Scalar.cpp
parent779d81f8d269a85069eb63db7540ae7da4d824d1 (diff)
downloadbcm5719-llvm-143a9e0b1236d42d12f872eef0cb8fde026db1da.tar.gz
bcm5719-llvm-143a9e0b1236d42d12f872eef0cb8fde026db1da.zip
[CodeComplete] Fix assertion failure
Summary: ...that fires when running completion inside an argument of UnresolvedMemberExpr (see the added test). The assertion that fires is from Sema::TryObjectArgumentInitialization: assert(FromClassification.isLValue()); This happens because Sema::AddFunctionCandidates does not account for object types which are pointers. It ends up classifying them incorrectly. All usages of the function outside code completion are used to run overload resolution for operators. In those cases the object type being passed is always a non-pointer type, so it's not surprising the function did not expect a pointer in the object argument. However, code completion reuses the same function and calls it with the object argument coming from UnresolvedMemberExpr, which can be a pointer if the member expr is an arrow ('->') access. Extending AddFunctionCandidates to allow pointer object types does not seem too crazy since all the functions down the call chain can properly handle pointer object types if we properly classify the object argument as an l-value, i.e. the classification of the implicitly dereferenced pointer. Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55331 llvm-svn: 348590
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Scalar.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud