diff options
| -rw-r--r-- | clang/include/clang/Sema/Lookup.h | 3 | ||||
| -rw-r--r-- | clang/test/Modules/submodule-visibility.cpp | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/clang/include/clang/Sema/Lookup.h b/clang/include/clang/Sema/Lookup.h index f291a8aef05..87c40f0cf20 100644 --- a/clang/include/clang/Sema/Lookup.h +++ b/clang/include/clang/Sema/Lookup.h @@ -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); diff --git a/clang/test/Modules/submodule-visibility.cpp b/clang/test/Modules/submodule-visibility.cpp index b2c5fc7ba19..345ae155bb3 100644 --- a/clang/test/Modules/submodule-visibility.cpp +++ b/clang/test/Modules/submodule-visibility.cpp @@ -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; |

