[all-commits] [llvm/llvm-project] e9d50d: [analyzer] Resolve lambda captures for explicit ob...

Benedek Kaibas via All-commits all-commits at lists.llvm.org
Mon Sep 14 04:02:36 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9d50d35104db2a3ac87e1280e043a0e7f4f7e4d
      https://github.com/llvm/llvm-project/commit/e9d50d35104db2a3ac87e1280e043a0e7f4f7e4d
  Author: Benedek Kaibas <82393336+benedekaibas at users.noreply.github.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
    M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
    A clang/test/Analysis/explicit-lambda-capture.cpp

  Log Message:
  -----------
  [analyzer] Resolve lambda captures for explicit object parameters (#219726)

Currently explicit object parameters are not modeled in the
`VisitCommonDeclRefExpr` function in `ExprEngine`. Because of this when
a lambda has an explicit object parameter and a possible division by
zero the `core.DivideZero` checker does not emit warning. This PR solves
that issue by deciding if the lambda has an explicit object parameter
and then records the binding (if the parameter has the reference type)
between the parameter and the argument's expression otherwise it returns
the captured field's lvalue.

This PR fixes #218708



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