[clang] [Clang] Fix a concept subsumption bug when template depths are adjusted (PR #186735)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 18:58:38 PDT 2026
================
@@ -2575,7 +2544,15 @@ bool Sema::IsAtLeastAsConstrained(const NamedDecl *D1,
}
SubsumptionChecker SC(*this);
- std::optional<bool> Subsumes = SC.Subsumes(D1, AC1, D2, AC2);
+ // Associated declarations are used as a cache key in the event they were
+ // normalized earlier during concept checking. However we cannot reuse these
+ // cached results if any of the template depths have been adjusted.
+ const NamedDecl *DeclAC1 = D1, *DeclAC2 = D2;
+ if (Depth2 > Depth1)
----------------
shafik wrote:
I have to say the naming here is really not great, I don't have suggestions but the names don't help me understand the code at all.
https://github.com/llvm/llvm-project/pull/186735
More information about the cfe-commits
mailing list