[all-commits] [llvm/llvm-project] d0646c: [LifetimeSafety] Fix false negative for GSL Owner ...

Zhijie Wang via All-commits all-commits at lists.llvm.org
Mon May 25 14:21:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d0646cbe307dd2bd10686f923061a7d981263e40
      https://github.com/llvm/llvm-project/commit/d0646cbe307dd2bd10686f923061a7d981263e40
  Author: Zhijie Wang <yesterda9 at gmail.com>
  Date:   2026-05-25 (Mon, 25 May 2026)

  Changed paths:
    M clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
    M clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
    M clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
    M clang/lib/Sema/CheckExprLifetime.cpp
    M clang/test/Sema/warn-lifetime-safety.cpp

  Log Message:
  -----------
  [LifetimeSafety] Fix false negative for GSL Owner methods inherited from a non-Owner base (#197864)

- Take the implicit object's actual type (e.g., the type before any
`DerivedToBase` cast) into account when checking for GSL Owner. Other
`isGslOwnerType` call sites with the same pattern (e.g.,
`isGslOwnerType(MCE->getImplicitObjectArgument()->getType())` in
`VisitCXXMemberCallExpr`) lack a real-world trigger today and are
deferred to a follow-up.
- Unify the GSL Owner checks inside `shouldTrackImplicitObjectArg` so
they share a single source of truth.

Fixes: #188832



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list