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.
llvm-svn: 315379
13 lines
169 B
C++
13 lines
169 B
C++
// RUN: %clang_cc1 -std=c++17 -fmodules-ts %s
|
|
|
|
typedef struct {
|
|
int c;
|
|
union {
|
|
int n;
|
|
char c[4];
|
|
} v;
|
|
} mbstate;
|
|
|
|
export module M;
|
|
export using ::mbstate;
|