llvm-project
dedc0848 - [alpha.webkit.NoDeleteChecker] Handle CXXStdInitializerListExpr in trivial analysis (#224723)

Commit
6 days ago
[alpha.webkit.NoDeleteChecker] Handle CXXStdInitializerListExpr in trivial analysis (#224723) TrivialFunctionAnalysisVisitor had no handler for CXXStdInitializerListExpr, so a braced list bound to a std::initializer_list fell through to VisitStmt and was conservatively treated as non-trivial. This made any nodelete function containing e.g. std::min({a, b, c}) report that it "contains code that could destruct an object". The backing array of a std::initializer_list is a temporary whose lifetime ends in the enclosing function, so its elements really are destructed there. Accept the node when the array's element type is trivially destructible and recurse into the initializers, and keep rejecting it otherwise.
Author
Parents
Loading