This is an archive of the discontinued LLVM Phabricator instance.

[Bugfix] Disqualify unaddressable overload candidates when a function is directly called indirectly.
ClosedPublic

Authored by george.burgess.iv on Dec 16 2015, 2:42 PM.

Details

Summary

"directly called indirectly" wasn't a typo; I can't think of a better name for this pattern. :)

Currently, Sema treats foo() and (&foo)() both as direct calls of foo, for the purposes of overload resolution. CodeGen treats the latter as an indirect call. This allows one to write code that indirectly calls an unaddressable function, which can result in ICEs (yay pass_object_size).

It seems that some code relies on how Sema resolves (&foo)(), so I don't think we can simply ask AddressOfFunctionResolver to handle this for us.

Diff Detail

Repository
rL LLVM

Event Timeline

george.burgess.iv retitled this revision from to [Bugfix] Disqualify unaddressable overload candidates when a function is directly called indirectly..
george.burgess.iv updated this object.
george.burgess.iv added a reviewer: rsmith.
george.burgess.iv added a subscriber: cfe-commits.
rsmith accepted this revision.Jan 6 2016, 5:42 PM
rsmith edited edge metadata.
This revision is now accepted and ready to land.Jan 6 2016, 5:42 PM
This revision was automatically updated to reflect the committed changes.