Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][Sema] Fix a bug on type constraint checking (#84671)
Try to fix #84368 When visiting class members in `TemplateDeclInstantiator::VisitClassTemplateDecl` during `Sema::InstantiateClass`, we miss to set attribute of friend declaration if it is(`isFriend` is true). This will lead to `Sema::AreConstraintExpressionsEqual` return false when invoked in `MatchTemplateParameterKind`. Because it makes `Sema::getTemplateInstantiationArgs` returns incorrect template argument(`MultiLevelTemplateArgumentList`). When we handle `CXXRecordDecl` In `Sema::getTemplateInstantiationArgs`, friend declaration(its parent context is `FileContext`) makes us to choose `LexicalDeclContext` not `DeclContext` and this is what we want. Co-authored-by: huqizhi <[email protected]>
- Loading branch information