This is an archive of the discontinued LLVM Phabricator instance.

[MS] Don't statically initialize dllimport member function pointers
ClosedPublic

Authored by rnk on Jun 27 2017, 3:44 PM.

Details

Summary

r306137 made dllimport pointers to member functions non-constant. This
is correct because a load must be executed to resolve any dllimported
data. However, r306137 did not account for the use of dllimport member
function pointers used as template arguments.

This change piggie-backs almost entirely on Reid's r306137, I just added
the template instantiation fix.

This fixes PR33570.

Event Timeline

majnemer created this revision.Jun 27 2017, 3:44 PM
rnk edited edge metadata.Jun 27 2017, 5:52 PM

Did you locally add a test case for the dllimport member function pointer template argument?

lib/Sema/SemaTemplate.cpp
5704

Think we should pass in Entity as an optional parameter to isNullPointerValueTemplateArgument to share the logic?

In D34714#793205, @rnk wrote:

Did you locally add a test case for the dllimport member function pointer template argument?

Arg, yes. Forgot to add the file...

lib/Sema/SemaTemplate.cpp
5704

Seems reasonable, I'll give that a go.

rnk added a comment.Jun 30 2017, 9:26 AM

Have a minute to get to this? My attempt to work around the bug in Chromium was incomplete.

rnk commandeered this revision.Jul 7 2017, 2:44 PM
rnk edited reviewers, added: majnemer; removed: rnk.

@majnemer will be back Monday, grabbing this.

This revision was automatically updated to reflect the committed changes.