================ @@ -4383,7 +4383,6 @@ static void handleAlignValueAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } void Sema::AddAlignValueAttr(Decl *D, const AttributeCommonInfo &CI, Expr *E) { - AlignValueAttr TmpAttr(Context, CI, E); ---------------- erichkeane wrote:
This attribute created on the stack is a smell. I note a few have the same problem: The following 5 functions (via manual search :/) have an attribute created on the stack: `Sema::AddAssumeAlignedAttr` `Sema::AddAllocAlignAttr` `Sema::AddAlignedAttr` x2 (1 type and 1 expr implementation) `Sema::CreateLaunchBoundsAttr` Of these: `Sema::AddAssumeAlignedAttr` Has the EXACT same problem (using it in a diag). So a repro should be the same `Sema::AddAllocAlignAttr` << Same problem with diag again `Sema::AddAlignedAttr` x2 (1 type and 1 expr implementation) << Neither seem to have this problem `Sema::CreateLaunchBoundsAttr` << All diagnostics are in a separate file at least, so the attribute isn't out of scope immediately after `makeLaunchBoundsExpr` I would love to have the others cleaned up, but only the 1st 2 actually have this exact issue, and should probably be cleaned up here. https://github.com/llvm/llvm-project/pull/135013 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits