forked from OSchip/llvm-project
[modules] When a declaration has non-trivial visibility, check whether it's
actually hidden before we check its linkage. This avoids computing the linkage "too early" for an anonymous struct with a typedef name for linkage. llvm-svn: 253012
This commit is contained in:
parent
978cbc54bc
commit
6e132bef6f
|
@ -303,8 +303,7 @@ public:
|
|||
if (!D->isInIdentifierNamespace(IDNS))
|
||||
return nullptr;
|
||||
|
||||
if (!D->isHidden() || isHiddenDeclarationVisible(D) ||
|
||||
isVisibleSlow(getSema(), D))
|
||||
if (isVisible(getSema(), D) || isHiddenDeclarationVisible(D))
|
||||
return D;
|
||||
|
||||
return getAcceptableDeclSlow(D);
|
||||
|
|
|
@ -28,3 +28,10 @@ int k = n + m; // OK, a and b are visible here.
|
|||
#ifndef B
|
||||
#error B is not defined
|
||||
#endif
|
||||
|
||||
// Ensure we don't compute the linkage of this struct before we find it has a
|
||||
// typedef name for linkage purposes.
|
||||
typedef struct {
|
||||
int p;
|
||||
void (*f)(int p);
|
||||
} name_for_linkage;
|
||||
|
|
Loading…
Reference in New Issue