[all-commits] [llvm/llvm-project] e305d5: [clang] fix lambda dependency issue with late pars...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Thu Oct 2 19:24:42 PDT 2025


  Branch: refs/heads/users/mizvekov/GH161657
  Home:   https://github.com/llvm/llvm-project
  Commit: e305d573c6237f4442886d1c4f267382c2281fc5
      https://github.com/llvm/llvm-project/commit/e305d573c6237f4442886d1c4f267382c2281fc5
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-10-02 (Thu, 02 Oct 2025)

  Changed paths:
    M clang/lib/Sema/SemaExprCXX.cpp
    A clang/test/SemaTemplate/GH161657.cpp

  Log Message:
  -----------
  [clang] fix lambda dependency issue with late parse attributes

This fixes a regression introduced in #147835

When parsing a lambda where the call operator has a late parsed attribute,
we would try to build a 'this' type for the lambda, but in a lambda 'this'
never refers to the lambda class itself.

This late parsed attribute can be added implicitly by the -ftrapping-math flag.

This patch patch makes it so CXXThisScopeRAII ignores lambdas.

This became observable in #147835 because that made clang lazily create
tag types, and it removed a workaround for a lambda dependency bug
where any previously created tag type for the lambda is dicarded after
its dependency is recalculated.

But the 'this' scope created above would defeat this laziness and create
the lambda type too soon, before its dependency was updated.

Since this regression was never released, there are no release notes.

Fixes #161657



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