@@ -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,
@@ -5475,10 +5485,9 @@ Sema::BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS,
5475
5485
RequireCompleteDeclContext (SS, DC))
5476
5486
return BuildDependentDeclRefExpr (SS, TemplateKWLoc, NameInfo, TemplateArgs);
5477
5487
5478
- bool MemberOfUnknownSpecialization;
5479
5488
LookupResult R (*this , NameInfo, LookupOrdinaryName);
5480
5489
if (LookupTemplateName (R, (Scope *)nullptr , SS, QualType (),
5481
- /* Entering*/ false , MemberOfUnknownSpecialization,
5490
+ /* Entering*/ false ,
5482
5491
TemplateKWLoc))
5483
5492
return ExprError ();
5484
5493
@@ -5600,14 +5609,13 @@ TemplateNameKind Sema::ActOnTemplateName(Scope *S,
5600
5609
DeclarationNameInfo DNI = GetNameFromUnqualifiedId (Name);
5601
5610
LookupResult R (*this , DNI.getName (), Name.getBeginLoc (),
5602
5611
LookupOrdinaryName);
5603
- bool MOUS;
5604
5612
// Tell LookupTemplateName that we require a template so that it diagnoses
5605
5613
// cases where it finds a non-template.
5606
5614
RequiredTemplateKind RTK = TemplateKWLoc.isValid ()
5607
5615
? RequiredTemplateKind (TemplateKWLoc)
5608
5616
: TemplateNameIsRequired;
5609
- if (!LookupTemplateName (R, S, SS, ObjectType.get (), EnteringContext, MOUS,
5610
- RTK, nullptr , /* AllowTypoCorrection=*/ false ) &&
5617
+ if (!LookupTemplateName (R, S, SS, ObjectType.get (), EnteringContext,
5618
+ RTK, /* ATK= */ nullptr , /* AllowTypoCorrection=*/ false ) &&
5611
5619
!R.isAmbiguous ()) {
5612
5620
if (LookupCtx)
5613
5621
Diag (Name.getBeginLoc (), diag::err_no_member)
0 commit comments