[C++20] [Modules] Only allow redeclarations in partitions if they are in the same...
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Sat, 8 Oct 2022 09:05:44 +0000 (17:05 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Sat, 8 Oct 2022 09:44:04 +0000 (17:44 +0800)
commit0c4f0bf40d17d516aff54f6cea79b69101085799
treeb221a6560002ae3d001fb3ad6f707e08720e75a6
parent9974ed804995d2e34be69404e9904c7e03cfbda4
[C++20] [Modules] Only allow redeclarations in partitions if they are in the same module

Closes https://github.com/llvm/llvm-project/issues/58196.

The root cause for the problem is an oversight in
https://reviews.llvm.org/D127624, which allows the redeclarations in
partitions. However, we took a mistake there that we should only allow
it if the redeclarations in the one same module instead of return
directly if either the redeclaration lives in a partition. The original
implementation makes no sense and I believe it was an oversight.
clang/lib/Sema/SemaDecl.cpp
clang/test/Modules/inconsistent-deduction-guide-linkage.cppm [new file with mode: 0644]