diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-06-28 15:40:55 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-06-28 16:12:50 +0800 |
commit | 76864e6af134aa240069d42ba15e0b89fd7d6b4c (patch) | |
tree | 2fb30113420de48eee63d408555eaf44a8aed5f4 /clang/lib/Sema/SemaLookup.cpp | |
parent | 7934fcef26c2e5e7d451bb9c36b5a344b342a015 (diff) | |
download | llvm-76864e6af134aa240069d42ba15e0b89fd7d6b4c.zip llvm-76864e6af134aa240069d42ba15e0b89fd7d6b4c.tar.gz llvm-76864e6af134aa240069d42ba15e0b89fd7d6b4c.tar.bz2 |
[C++20] [Modules] Don't find module for linkage for decls in global
module
Possibly fix https://github.com/llvm/llvm-project/issues/96693
The direct reason is that we are calculating the linkage for the
declaration too early so that the linkage got calculated incorrectly.
And after I look into the problem, I found it is completely not
necessary to calculate the linkage there. It is for ModulesTS. So I
simply removes that legacy experimental code and fix the issue.
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 12b13eb..9a3fabc 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -5965,7 +5965,7 @@ RedeclarationKind Sema::forRedeclarationInCurContext() const { // anything that is not visible. We don't need to check linkage here; if // the context has internal linkage, redeclaration lookup won't find things // from other TUs, and we can't safely compute linkage yet in general. - if (cast<Decl>(CurContext)->getOwningModuleForLinkage(/*IgnoreLinkage*/ true)) + if (cast<Decl>(CurContext)->getOwningModuleForLinkage()) return RedeclarationKind::ForVisibleRedeclaration; return RedeclarationKind::ForExternalRedeclaration; } |