This is an archive of the discontinued LLVM Phabricator instance.

Don't allow dllimport variables in constant initializers
ClosedPublic

Authored by hans on Jun 25 2014, 3:13 PM.

Details

Summary

This is a follow-up to David's r211677. For the following code, we would end up referring to 'foo' in the initializer for 'arr', and then fail to link, because 'foo' is dllimport and needs to be accessed through the __imp_?foo.

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 10858.Jun 25 2014, 3:13 PM
hans retitled this revision from to Don't allow dllimport variables in constant initializers.
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added reviewers: majnemer, hansw.
hans added a subscriber: Unknown Object (MLST).
majnemer accepted this revision.Jun 25 2014, 3:25 PM
majnemer edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jun 25 2014, 3:25 PM
hans closed this revision.Jun 25 2014, 3:28 PM
hans updated this revision to Diff 10859.

Closed by commit rL211736 (authored by @hans).

rnk added a subscriber: rnk.Jun 25 2014, 5:01 PM

This seems problematic for mingw, where I expect users probably use non-type template parameters of dllimported stuff. Is there another way we can handle this?