[all-commits] [llvm/llvm-project] 3784e8: [Clang] Fix Unevaluated Lambdas

cor3ntin via All-commits all-commits at lists.llvm.org
Fri Mar 25 11:17:00 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3784e8ccfbdaaab31f9e9c221daa59a218279999
      https://github.com/llvm/llvm-project/commit/3784e8ccfbdaaab31f9e9c221daa59a218279999
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2022-03-25 (Fri, 25 Mar 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/DeclBase.cpp
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/Sema/SemaLambda.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/SemaCXX/lambda-unevaluated.cpp
    M clang/unittests/AST/ASTImporterTest.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  [Clang] Fix Unevaluated Lambdas

Unlike other types, when lambdas are instanciated,
they are recreated from scratch.
When an unevaluated lambdas appear in the type of a function,
parameter it is instanciated in the wrong declaration context,
as parameters are transformed before the function.

To support lambda in function parameters, we try to
compute whether they are dependant without looking at the
declaration context.

This is a short term stopgap solution to avoid clang
iceing. A better fix might be to inject some kind of
transparent declaration with correctly computed dependency
for function parameters, variable templates, etc.

Fixes https://github.com/llvm/llvm-project/issues/50376
Fixes https://github.com/llvm/llvm-project/issues/51414
Fixes https://github.com/llvm/llvm-project/issues/51416
Fixes https://github.com/llvm/llvm-project/issues/51641
Fixes https://github.com/llvm/llvm-project/issues/54296

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list