Commit Graph

3 Commits

Author SHA1 Message Date
Richard Smith 6bbe311027 [Modules TS] Module ownership semantics for redeclarations.
When declaring an entity in the "purview" of a module, it's never a
redeclaration of an entity in the purview of a default module or in no module
("in the global module"). Don't consider those other declarations as possible
redeclaration targets if they're not visible, and reject any cases where we
pick a prior visible declaration that violates this rule.

This reinstates r315251 and r315256, reverted in r315309 and r315308
respectively, tweaked to avoid triggering a linkage calculation when declaring
implicit special members (this exposed our pre-existing issue with typedef
names for linkage changing the linkage of types whose linkage has already been
computed and cached in more cases). A testcase for that regression has been
added in r315366.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315379 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 22:33:17 +00:00
Eric Liu 5c21b0272a Revert "[Modules TS] Avoid computing the linkage of the enclosing DeclContext for a declaration in the global module."
This reverts commit r315256. See the original commit thread for reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 13:00:18 +00:00
Richard Smith aad768a1a5 [Modules TS] Avoid computing the linkage of the enclosing DeclContext for a declaration in the global module.
This works around a language issue where adding a typedef name for linkage
purposes changes the linkage of an already-defined class after it becomes
complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 00:49:38 +00:00