diff options
author | Corentin Jabot <corentinjabot@gmail.com> | 2023-09-07 09:50:25 +0200 |
---|---|---|
committer | Corentin Jabot <corentinjabot@gmail.com> | 2023-09-07 09:50:25 +0200 |
commit | 98062d8fefbd3539a63e7e6a85ff12a41543357c (patch) | |
tree | dc59b9ac39701be17500770879805c62ac6d9755 /clang/lib/Sema/SemaLambda.cpp | |
parent | edae8f6ce29a980d83761f59f81b88167a0fd815 (diff) | |
download | llvm-98062d8fefbd3539a63e7e6a85ff12a41543357c.zip llvm-98062d8fefbd3539a63e7e6a85ff12a41543357c.tar.gz llvm-98062d8fefbd3539a63e7e6a85ff12a41543357c.tar.bz2 |
Revert "[Clang] Add captures to the instantiation scope of lambda call operators"
The change causes some libcxx regressions
This reverts commit eaf725bc9371a6699902d67d97662caaa3332799.
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 1702ddb..5256d91 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -20,7 +20,6 @@ #include "clang/Sema/ScopeInfo.h" #include "clang/Sema/SemaInternal.h" #include "clang/Sema/SemaLambda.h" -#include "clang/Sema/Template.h" #include "llvm/ADT/STLExtras.h" #include <optional> using namespace clang; @@ -2255,34 +2254,3 @@ ExprResult Sema::BuildBlockForLambdaConversion(SourceLocation CurrentLocation, return BuildBlock; } - -Sema::LambdaScopeForCallOperatorInstantiationRAII:: - LambdaScopeForCallOperatorInstantiationRAII( - Sema &SemasRef, FunctionDecl *FD, MultiLevelTemplateArgumentList MLTAL, - LocalInstantiationScope &Scope) - : FunctionScopeRAII(SemasRef) { - if (!isLambdaCallOperator(FD)) { - FunctionScopeRAII::disable(); - return; - } - - if (FD->isTemplateInstantiation() && FD->getPrimaryTemplate()) { - FunctionTemplateDecl *PrimaryTemplate = FD->getPrimaryTemplate(); - if (const auto *FromMemTempl = - PrimaryTemplate->getInstantiatedFromMemberTemplate()) { - SemasRef.addInstantiatedCapturesToScope( - FD, FromMemTempl->getTemplatedDecl(), Scope, MLTAL); - } - } - - else if (FD->getTemplatedKind() == FunctionDecl::TK_MemberSpecialization || - FD->getTemplatedKind() == FunctionDecl::TK_DependentNonTemplate) { - FunctionDecl *InstantiatedFrom = - FD->getTemplatedKind() == FunctionDecl::TK_MemberSpecialization - ? FD->getInstantiatedFromMemberFunction() - : FD->getInstantiatedFromDecl(); - SemasRef.addInstantiatedCapturesToScope(FD, InstantiatedFrom, Scope, MLTAL); - } - - SemasRef.RebuildLambdaScopeInfo(cast<CXXMethodDecl>(FD)); -} |