[all-commits] [llvm/llvm-project] bd77a2: [Clang][Sema] Properly get captured 'this' pointer...

Sirraide via All-commits all-commits at lists.llvm.org
Wed Mar 13 10:50:05 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bd77a26e9a15981114e9802d83047f42631125a2
      https://github.com/llvm/llvm-project/commit/bd77a26e9a15981114e9802d83047f42631125a2
  Author: Sirraide <aeternalmail at gmail.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/ExprConstant.cpp
    A clang/test/SemaCXX/constexpr-explicit-object-lambda.cpp

  Log Message:
  -----------
  [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (#81102)

There were some bugs wrt explicit object parameters in lambdas in the
constant evaluator:
- The code evaluating a `CXXThisExpr` wasn’t checking for explicit
object parameters at all and thus assumed that there was no `this` in
the current context because the lambda didn’t have one, even though we
were in a member function and had captured its `this`.
- The code retrieving captures as lvalues *did* account for explicit
object parameters, but it did not handle the case of the explicit object
parameter being passed by value rather than by reference.

This fixes #80997.

---------

Co-authored-by: cor3ntin <corentinjabot at gmail.com>
Co-authored-by: Aaron Ballman <aaron at aaronballman.com>



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