[all-commits] [llvm/llvm-project] d219c6: [Clang] Fix crash with `source_location` in lambda...

cor3ntin via All-commits all-commits at lists.llvm.org
Thu Sep 5 11:45:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d219c63b16851ba264b6495e3f63016d1c8b2aac
      https://github.com/llvm/llvm-project/commit/d219c63b16851ba264b6495e3f63016d1c8b2aac
  Author: cor3ntin <corentinjabot at gmail.com>
  Date:   2024-09-05 (Thu, 05 Sep 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/Expr.cpp
    M clang/test/SemaCXX/source_location.cpp

  Log Message:
  -----------
  [Clang] Fix crash with `source_location` in lambda declarators. (#107411)

Parsing lambdas require pushing a declaration context for the lambda, so
that parameters can be attached to it, before its trailing type is
parsed. DAt that point, partially-parsed lambda don't have a name that
can be computed for then.
This would cause source_location::current() to crash when use in the
decltype of a lambda().
We work around this by producing a source_location for an enclosing
scope in that scenario.

Fixes #67134



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