[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 06:35:46 PDT 2024


================
@@ -1056,16 +1052,20 @@ bool Sema::AreConstraintExpressionsEqual(const NamedDecl *Old,
 bool Sema::FriendConstraintsDependOnEnclosingTemplate(const FunctionDecl *FD) {
   assert(FD->getFriendObjectKind() && "Must be a friend!");
 
+  FunctionTemplateDecl *FTD = FD->getDescribedFunctionTemplate();
   // The logic for non-templates is handled in ASTContext::isSameEntity, so we
   // don't have to bother checking 'DependsOnEnclosingTemplate' for a
   // non-function-template.
-  assert(FD->getDescribedFunctionTemplate() &&
-         "Non-function templates don't need to be checked");
+  assert(FTD && "Non-function templates don't need to be checked");
 
   SmallVector<const Expr *, 3> ACs;
-  FD->getDescribedFunctionTemplate()->getAssociatedConstraints(ACs);
+  FTD->getAssociatedConstraints(ACs);
 
+#if 0
----------------
sdkrystian wrote:

Yup. There are still a few others I need to clean up

https://github.com/llvm/llvm-project/pull/106585


More information about the cfe-commits mailing list