[clang] [LifeitimeSafety] Support C Language in LifetimeSafety (PR #203270)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 11 07:14:45 PDT 2026
================
@@ -347,6 +353,12 @@ void FactsGenerator::VisitUnaryOperator(const UnaryOperator *UO) {
switch (UO->getOpcode()) {
case UO_AddrOf: {
const Expr *SubExpr = UO->getSubExpr();
+ // In C, function addresses do not need lifetime tracking. Also skip
----------------
Xazax-hun wrote:
This is the same in C++, functions have static lifetime, we do not need to track the lifetimes of function pointers. I wonder if that part should be the same in C and C++ mode.
Did this trigger an a crash or a false positive?
https://github.com/llvm/llvm-project/pull/203270
More information about the cfe-commits
mailing list