This is an archive of the discontinued LLVM Phabricator instance.

Avoid using LookupResult's implicit copy ctor and assignment operator to avoid warnings
ClosedPublic

Authored by myatsina on Mar 15 2016, 3:24 AM.

Details

Summary

The purpose of this patch is to keep the same functionality without using LookupResult's implicit copy ctor and assignment operator, because they cause warnings when -Wdeprecated is passed.
This patch is meant to help the following review: http://reviews.llvm.org/D18123.

Diff Detail

Repository
rL LLVM

Event Timeline

myatsina updated this revision to Diff 50707.Mar 15 2016, 3:24 AM
myatsina retitled this revision from to Avoid using LookupResult's implicit copy ctor and assignment operator to avoid warnings.
myatsina updated this object.
myatsina added reviewers: rnk, hintonda, rjmccall, dblaikie.
myatsina set the repository for this revision to rL LLVM.
myatsina added a subscriber: cfe-commits.
rjmccall edited edge metadata.Mar 15 2016, 9:53 AM

You can't call getFoundDecl() if !isSingleResult(). You should add a test case that actually tests the possibility that this lookup will fail.

dblaikie accepted this revision.Mar 15 2016, 10:51 AM
dblaikie edited edge metadata.

Looks good - thanks!

This revision is now accepted and ready to land.Mar 15 2016, 10:51 AM

Ignore Dave and fix the problem, please. :)

How can I create a test case where isSingleResult() returns false?
I don't see existent tests in the commit that added this method's functionality.

Hmm. Checking whether LookupName returns false will catch a lot of simple cases. I think the test case you need might have to be a lookup that finds multiple overloads of a function in C++.

myatsina updated this revision to Diff 50780.Mar 15 2016, 3:51 PM
myatsina edited edge metadata.

Adding requested test case + changing the code accordingly

Thank you, LGTM.

This revision was automatically updated to reflect the committed changes.