This is an archive of the discontinued LLVM Phabricator instance.

Don't dllimport/export class members with internal linkage (PR23308)
ClosedPublic

Authored by hans on Apr 21 2015, 7:56 PM.

Details

Summary

For example, a function taking a parameter with internal linkage will
itself have internal linkage since it cannot be called outside the
translation unit.

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 24192.Apr 21 2015, 7:56 PM
hans retitled this revision from to Don't dllimport/export class members with internal linkage (PR23308).
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added reviewers: thakis, rnk, majnemer.
hans added subscribers: Unknown Object (MLST), hansw.
majnemer edited edge metadata.Apr 21 2015, 8:08 PM

What happens if the export directive is on the function itself instead of the class? Does this deserve a diagnostic? What about the import side?

hans added a comment.Apr 21 2015, 8:35 PM

What happens if the export directive is on the function itself instead of the class? Does this deserve a diagnostic? What about the import side?

We diagnose it as an error if put directly on the function.

thakis edited edge metadata.Apr 21 2015, 9:04 PM

Looks good to me, thanks.

lib/Sema/SemaDeclCXX.cpp
4807 ↗(On Diff #24192)

nit: no braces

hans added a comment.Apr 21 2015, 9:08 PM

I'll land this now to unbreak the Chromium build. If David or Reid has more comments, we can do follow-up patches.

lib/Sema/SemaDeclCXX.cpp
4807 ↗(On Diff #24192)

Done.

This revision was automatically updated to reflect the committed changes.
rnk edited edge metadata.Apr 22 2015, 8:57 AM

Lgtm