[all-commits] [llvm/llvm-project] e7eec3: [clang] Skip re-building lambda expressions in par...

Utkarsh Saxena via All-commits all-commits at lists.llvm.org
Fri Sep 2 03:31:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7eec38246560781e0a4020b19c7eb038a8c5655
      https://github.com/llvm/llvm-project/commit/e7eec38246560781e0a4020b19c7eb038a8c5655
  Author: Utkarsh Saxena <usx at google.com>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/cxx2a-consteval.cpp

  Log Message:
  -----------
  [clang] Skip re-building lambda expressions in parameters to consteval fns.

As discussed in this [comment](https://github.com/llvm/llvm-project/issues/56183#issuecomment-1224331699),
we end up building the lambda twice: once while parsing the function calls and then again while handling the immediate invocation.

This happens specially during removing nested immediate invocation.
Eg: When we have another consteval function as the parameter along with this lambda expression. Eg: `foo(bar([]{}))`, `foo(bar(), []{})`

While removing such nested immediate invocations, we should not rebuild this lambda. (IIUC, rebuilding a lambda would always generate a new type which will never match the original type from parsing)

Fixes: https://github.com/llvm/llvm-project/issues/56183
Fixes: https://github.com/llvm/llvm-project/issues/51695
Fixes: https://github.com/llvm/llvm-project/issues/50455
Fixes: https://github.com/llvm/llvm-project/issues/54872
Fixes: https://github.com/llvm/llvm-project/issues/54587

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




More information about the All-commits mailing list