[all-commits] [llvm/llvm-project] 34abc5: [Clang] Fix a crash when taking the address of a c...

cor3ntin via All-commits all-commits at lists.llvm.org
Thu Feb 23 06:26:51 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34abc5b75d9d995ded56a9534c230300b06f1439
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2023-02-23 (Thu, 23 Feb 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaLambda.cpp
    M clang/test/AST/ast-dump-expr-json.cpp
    M clang/test/AST/ast-dump-expr.cpp
    M clang/test/AST/ast-dump-lambda.cpp
    M clang/test/SemaCXX/cxx2a-consteval.cpp

  Log Message:
  [Clang] Fix a crash when taking the address of a consteval lambda

The `_invoke` function of lambdas was not respecting
the constexpr/consteval specifier of the call operator, so it was possible
to take its address in a non-immmediately invoked context,
even if the call operator was itself consteval.

In addition, we improve the diagnostic emmited in the lambda case
not to show that `invoke` method.

Fixes #57682

Reviewed By: aaron.ballman, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D144627

More information about the All-commits mailing list