[clang] [llvm] [Clang] Fix cleanup attribute by delaying type checks after the type is deduced (PR #164440)

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 11:43:19 PST 2025


================
@@ -8311,3 +8301,27 @@ void Sema::redelayDiagnostics(DelayedDiagnosticPool &pool) {
   assert(curPool && "re-emitting in undelayed context not supported");
   curPool->steal(pool);
 }
+
+void Sema::ActOnCleanupAttr(Decl *D, const Attr *A) {
+  // Obtains the FunctionDecl that was found when handling the attribute
+  // earlier.
+  CleanupAttr *Attr = D->getAttr<CleanupAttr>();
+  FunctionDecl *FD = Attr->getFunctionDecl();
+  DeclarationNameInfo NI = FD->getNameInfo();
----------------
AaronBallman wrote:

These can be moved down to after the early return for dependent types.

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


More information about the llvm-commits mailing list