@@ -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,
@@ -5593,10 +5603,9 @@ Sema::BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS,
5593
5603
RequireCompleteDeclContext (SS, DC))
5594
5604
return BuildDependentDeclRefExpr (SS, TemplateKWLoc, NameInfo, TemplateArgs);
5595
5605
5596
- bool MemberOfUnknownSpecialization;
5597
5606
LookupResult R (*this , NameInfo, LookupOrdinaryName);
5598
5607
if (LookupTemplateName (R, (Scope *)nullptr , SS, QualType (),
5599
- /* Entering*/ false , MemberOfUnknownSpecialization,
5608
+ /* Entering*/ false ,
5600
5609
TemplateKWLoc))
5601
5610
return ExprError ();
5602
5611
@@ -5718,14 +5727,13 @@ TemplateNameKind Sema::ActOnTemplateName(Scope *S,
5718
5727
DeclarationNameInfo DNI = GetNameFromUnqualifiedId (Name);
5719
5728
LookupResult R (*this , DNI.getName (), Name.getBeginLoc (),
5720
5729
LookupOrdinaryName);
5721
- bool MOUS;
5722
5730
// Tell LookupTemplateName that we require a template so that it diagnoses
5723
5731
// cases where it finds a non-template.
5724
5732
RequiredTemplateKind RTK = TemplateKWLoc.isValid ()
5725
5733
? RequiredTemplateKind (TemplateKWLoc)
5726
5734
: TemplateNameIsRequired;
5727
- if (!LookupTemplateName (R, S, SS, ObjectType.get (), EnteringContext, MOUS,
5728
- RTK, nullptr , /* AllowTypoCorrection=*/ false ) &&
5735
+ if (!LookupTemplateName (R, S, SS, ObjectType.get (), EnteringContext,
5736
+ RTK, /* ATK= */ nullptr , /* AllowTypoCorrection=*/ false ) &&
5729
5737
!R.isAmbiguous ()) {
5730
5738
if (LookupCtx)
5731
5739
Diag (Name.getBeginLoc (), diag::err_no_member)
0 commit comments