|
12 | 12 | #include "TreeTransform.h"
|
13 | 13 | #include "clang/AST/ASTConsumer.h"
|
14 | 14 | #include "clang/AST/ASTContext.h"
|
15 |
| -#include "clang/AST/ASTLambda.h" |
16 | 15 | #include "clang/AST/ASTMutationListener.h"
|
17 | 16 | #include "clang/AST/DeclTemplate.h"
|
18 | 17 | #include "clang/AST/DependentDiagnostic.h"
|
@@ -5277,26 +5276,9 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
|
5277 | 5276 | RebuildTypeSourceInfoForDefaultSpecialMembers();
|
5278 | 5277 | SetDeclDefaulted(Function, PatternDecl->getLocation());
|
5279 | 5278 | } else {
|
5280 |
| - NamedDecl *ND = Function; |
5281 |
| - DeclContext *DC = ND->getLexicalDeclContext(); |
5282 |
| - std::optional<ArrayRef<TemplateArgument>> Innermost; |
5283 |
| - if (auto *Primary = Function->getPrimaryTemplate(); |
5284 |
| - Primary && |
5285 |
| - !isGenericLambdaCallOperatorOrStaticInvokerSpecialization(Function) && |
5286 |
| - Function->getTemplateSpecializationKind() != |
5287 |
| - TSK_ExplicitSpecialization) { |
5288 |
| - auto It = llvm::find_if(Primary->redecls(), |
5289 |
| - [](const RedeclarableTemplateDecl *RTD) { |
5290 |
| - return cast<FunctionTemplateDecl>(RTD) |
5291 |
| - ->isCompatibleWithDefinition(); |
5292 |
| - }); |
5293 |
| - assert(It != Primary->redecls().end() && |
5294 |
| - "Should't get here without a definition"); |
5295 |
| - DC = (*It)->getLexicalDeclContext(); |
5296 |
| - Innermost.emplace(Function->getTemplateSpecializationArgs()->asArray()); |
5297 |
| - } |
5298 | 5279 | MultiLevelTemplateArgumentList TemplateArgs = getTemplateInstantiationArgs(
|
5299 |
| - Function, DC, /*Final=*/false, Innermost, false, PatternDecl); |
| 5280 | + Function, Function->getLexicalDeclContext(), /*Final=*/false, |
| 5281 | + /*Innermost=*/std::nullopt, false, PatternDecl); |
5300 | 5282 |
|
5301 | 5283 | // Substitute into the qualifier; we can get a substitution failure here
|
5302 | 5284 | // through evil use of alias templates.
|
|
0 commit comments