This is an archive of the discontinued LLVM Phabricator instance.

[ms] Do lookup in dependent base classes also when overload resolution fails (PR23810)
ClosedPublic

Authored by hans on Jun 10 2015, 3:49 PM.

Details

Summary

This patch does two things in order to enable compilation of the problematic code in PR23810:

In Sema::buildOverloadedCallSet, it postpones lookup for MS mode when no viable candidate is found in the overload set. Previously, lookup would only be postponed here if the overload set was empty.

Make BuildRecoveryCallExpr call Sema::DiagnoseEmptyLookup under more circumstances. There is a comment in DiagnoseTwoPhaseLookup that says "Don't diagnose names we find in classes; we get much better diagnostics for these from DiagnoseEmptyLookup." The problem was that DiagnoseEmptyLookup might not get called later, and we failed to recover.

Please take a look!

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 27468.Jun 10 2015, 3:49 PM
hans retitled this revision from to [ms] Do lookup in dependent base classes also when overload resolution fails (PR23810).
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added reviewers: rnk, rsmith.
hans added subscribers: Unknown Object (MLST), hansw.
hans updated this revision to Diff 27475.Jun 10 2015, 4:10 PM

Fix PR nbr in the test case.

rnk edited edge metadata.Jun 11 2015, 11:53 AM

Oh dear, this is when error recovery and ms compatibility hacks get in the way of each other. :-(

hans added a comment.Jun 11 2015, 2:04 PM
In D10369#186935, @rnk wrote:

Oh dear, this is when error recovery and ms compatibility hacks get in the way of each other. :-(

So... do you think me piling on another hack here is ok? :-)

This revision was automatically updated to reflect the committed changes.