@@ -319,15 +319,12 @@ TemplateNameKind Sema::isTemplateName(Scope *S,
319
319
bool Sema::isDeductionGuideName (Scope *S, const IdentifierInfo &Name,
320
320
SourceLocation NameLoc, CXXScopeSpec &SS,
321
321
ParsedTemplateTy *Template /* =nullptr*/ ) {
322
- bool MemberOfUnknownSpecialization = false ;
323
-
324
322
// We could use redeclaration lookup here, but we don't need to: the
325
323
// syntactic form of a deduction guide is enough to identify it even
326
324
// if we can't look up the template name at all.
327
325
LookupResult R (*this , DeclarationName (&Name), NameLoc, LookupOrdinaryName);
328
326
if (LookupTemplateName (R, S, SS, /* ObjectType*/ QualType (),
329
- /* EnteringContext*/ false ,
330
- MemberOfUnknownSpecialization))
327
+ /* EnteringContext*/ false ))
331
328
return false ;
332
329
333
330
if (R.empty ()) return false ;
@@ -373,6 +370,19 @@ bool Sema::DiagnoseUnknownTemplateName(const IdentifierInfo &II,
373
370
return true ;
374
371
}
375
372
373
+ bool Sema::LookupTemplateName (LookupResult &Found,
374
+ Scope *S, CXXScopeSpec &SS,
375
+ QualType ObjectType,
376
+ bool EnteringContext,
377
+ RequiredTemplateKind RequiredTemplate,
378
+ AssumedTemplateKind *ATK,
379
+ bool AllowTypoCorrection) {
380
+ bool MemberOfUnknownSpecialization;
381
+ return LookupTemplateName (Found, S, SS, ObjectType, EnteringContext,
382
+ MemberOfUnknownSpecialization, RequiredTemplate,
383
+ ATK, AllowTypoCorrection);
384
+ }
385
+
376
386
bool Sema::LookupTemplateName (LookupResult &Found,
377
387
Scope *S, CXXScopeSpec &SS,
378
388
QualType ObjectType,
@@ -5447,10 +5457,9 @@ Sema::BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS,
5447
5457
RequireCompleteDeclContext (SS, DC))
5448
5458
return BuildDependentDeclRefExpr (SS, TemplateKWLoc, NameInfo, TemplateArgs);
5449
5459
5450
- bool MemberOfUnknownSpecialization;
5451
5460
LookupResult R (*this , NameInfo, LookupOrdinaryName);
5452
5461
if (LookupTemplateName (R, (Scope *)nullptr , SS, QualType (),
5453
- /* Entering*/ false , MemberOfUnknownSpecialization,
5462
+ /* Entering*/ false ,
5454
5463
TemplateKWLoc))
5455
5464
return ExprError ();
5456
5465
@@ -5572,14 +5581,13 @@ TemplateNameKind Sema::ActOnTemplateName(Scope *S,
5572
5581
DeclarationNameInfo DNI = GetNameFromUnqualifiedId (Name);
5573
5582
LookupResult R (*this , DNI.getName (), Name.getBeginLoc (),
5574
5583
LookupOrdinaryName);
5575
- bool MOUS;
5576
5584
// Tell LookupTemplateName that we require a template so that it diagnoses
5577
5585
// cases where it finds a non-template.
5578
5586
RequiredTemplateKind RTK = TemplateKWLoc.isValid ()
5579
5587
? RequiredTemplateKind (TemplateKWLoc)
5580
5588
: TemplateNameIsRequired;
5581
- if (!LookupTemplateName (R, S, SS, ObjectType.get (), EnteringContext, MOUS,
5582
- RTK, nullptr , /* AllowTypoCorrection=*/ false ) &&
5589
+ if (!LookupTemplateName (R, S, SS, ObjectType.get (), EnteringContext,
5590
+ RTK, /* ATK= */ nullptr , /* AllowTypoCorrection=*/ false ) &&
5583
5591
!R.isAmbiguous ()) {
5584
5592
if (LookupCtx)
5585
5593
Diag (Name.getBeginLoc (), diag::err_no_member)
0 commit comments