@@ -418,7 +418,7 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
418
418
NamedDecl *IIDecl = nullptr;
419
419
UsingShadowDecl *FoundUsingShadow = nullptr;
420
420
switch (Result.getResultKind()) {
421
- case LookupResult ::NotFound:
421
+ case LookupResultKind ::NotFound:
422
422
if (CorrectedII) {
423
423
TypeNameValidatorCCC CCC(/*AllowInvalid=*/true, isClassName,
424
424
AllowDeducedTemplate);
@@ -460,7 +460,7 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
460
460
}
461
461
Result.suppressDiagnostics();
462
462
return nullptr;
463
- case LookupResult ::NotFoundInCurrentInstantiation:
463
+ case LookupResultKind ::NotFoundInCurrentInstantiation:
464
464
if (AllowImplicitTypename == ImplicitTypenameContext::Yes) {
465
465
QualType T = Context.getDependentNameType(ElaboratedTypeKeyword::None,
466
466
SS->getScopeRep(), &II);
@@ -472,12 +472,12 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
472
472
return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T));
473
473
}
474
474
[[fallthrough]];
475
- case LookupResult ::FoundOverloaded:
476
- case LookupResult ::FoundUnresolvedValue:
475
+ case LookupResultKind ::FoundOverloaded:
476
+ case LookupResultKind ::FoundUnresolvedValue:
477
477
Result.suppressDiagnostics();
478
478
return nullptr;
479
479
480
- case LookupResult ::Ambiguous:
480
+ case LookupResultKind ::Ambiguous:
481
481
// Recover from type-hiding ambiguities by hiding the type. We'll
482
482
// do the lookup again when looking for an object, and we can
483
483
// diagnose the error then. If we don't do this, then the error
@@ -521,7 +521,7 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
521
521
// perform the name lookup again.
522
522
break;
523
523
524
- case LookupResult ::Found:
524
+ case LookupResultKind ::Found:
525
525
IIDecl = Result.getFoundDecl();
526
526
FoundUsingShadow = dyn_cast<UsingShadowDecl>(*Result.begin());
527
527
break;
@@ -657,7 +657,7 @@ DeclSpec::TST Sema::isTagName(IdentifierInfo &II, Scope *S) {
657
657
LookupResult R(*this, &II, SourceLocation(), LookupTagName);
658
658
LookupName(R, S, false);
659
659
R.suppressDiagnostics();
660
- if (R.getResultKind() == LookupResult ::Found)
660
+ if (R.getResultKind() == LookupResultKind ::Found)
661
661
if (const TagDecl *TD = R.getAsSingle<TagDecl>()) {
662
662
switch (TD->getTagKind()) {
663
663
case TagTypeKind::Struct:
@@ -926,7 +926,7 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS,
926
926
927
927
Corrected:
928
928
switch (Result.getResultKind()) {
929
- case LookupResult ::NotFound:
929
+ case LookupResultKind ::NotFound:
930
930
// If an unqualified-id is followed by a '(', then we have a function
931
931
// call.
932
932
if (SS.isEmpty() && NextToken.is(tok::l_paren)) {
@@ -1043,7 +1043,7 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS,
1043
1043
Result.suppressDiagnostics();
1044
1044
return NameClassification::Unknown();
1045
1045
1046
- case LookupResult ::NotFoundInCurrentInstantiation: {
1046
+ case LookupResultKind ::NotFoundInCurrentInstantiation: {
1047
1047
// We performed name lookup into the current instantiation, and there were
1048
1048
// dependent bases, so we treat this result the same way as any other
1049
1049
// dependent nested-name-specifier.
@@ -1061,12 +1061,12 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS,
1061
1061
return NameClassification::DependentNonType();
1062
1062
}
1063
1063
1064
- case LookupResult ::Found:
1065
- case LookupResult ::FoundOverloaded:
1066
- case LookupResult ::FoundUnresolvedValue:
1064
+ case LookupResultKind ::Found:
1065
+ case LookupResultKind ::FoundOverloaded:
1066
+ case LookupResultKind ::FoundUnresolvedValue:
1067
1067
break;
1068
1068
1069
- case LookupResult ::Ambiguous:
1069
+ case LookupResultKind ::Ambiguous:
1070
1070
if (getLangOpts().CPlusPlus && NextToken.is(tok::less) &&
1071
1071
hasAnyAcceptableTemplateNames(Result, /*AllowFunctionTemplates=*/true,
1072
1072
/*AllowDependent=*/false)) {
@@ -1498,11 +1498,11 @@ static bool AllowOverloadingOfFunction(const LookupResult &Previous,
1498
1498
// to check at least two; hence the 'any_of' check below. Note that
1499
1499
// the overloadable attribute is implicitly added to declarations
1500
1500
// that were required to have it but did not.
1501
- if (Previous.getResultKind() == LookupResult ::FoundOverloaded) {
1501
+ if (Previous.getResultKind() == LookupResultKind ::FoundOverloaded) {
1502
1502
return llvm::any_of(Previous, [](const NamedDecl *ND) {
1503
1503
return ND->hasAttr<OverloadableAttr>();
1504
1504
});
1505
- } else if (Previous.getResultKind() == LookupResult ::Found)
1505
+ } else if (Previous.getResultKind() == LookupResultKind ::Found)
1506
1506
return Previous.getFoundDecl()->hasAttr<OverloadableAttr>();
1507
1507
1508
1508
return false;
@@ -8290,7 +8290,7 @@ static SourceLocation getCaptureLocation(const LambdaScopeInfo *LSI,
8290
8290
static bool shouldWarnIfShadowedDecl(const DiagnosticsEngine &Diags,
8291
8291
const LookupResult &R) {
8292
8292
// Only diagnose if we're shadowing an unambiguous field or variable.
8293
- if (R.getResultKind() != LookupResult ::Found)
8293
+ if (R.getResultKind() != LookupResultKind ::Found)
8294
8294
return false;
8295
8295
8296
8296
// Return false if warning is ignored.
@@ -10504,7 +10504,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
10504
10504
// Recover gracefully from an invalid redeclaration.
10505
10505
D.setRedeclaration(true);
10506
10506
assert((NewFD->isInvalidDecl() || !D.isRedeclaration() ||
10507
- Previous.getResultKind() != LookupResult ::FoundOverloaded) &&
10507
+ Previous.getResultKind() != LookupResultKind ::FoundOverloaded) &&
10508
10508
"previous declaration set still overloaded");
10509
10509
10510
10510
// Diagnose no-prototype function declarations with calling conventions that
@@ -10671,7 +10671,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
10671
10671
10672
10672
assert((NewFD->isInvalidDecl() || NewFD->isMultiVersion() ||
10673
10673
!D.isRedeclaration() ||
10674
- Previous.getResultKind() != LookupResult ::FoundOverloaded) &&
10674
+ Previous.getResultKind() != LookupResultKind ::FoundOverloaded) &&
10675
10675
"previous declaration set still overloaded");
10676
10676
10677
10677
NamedDecl *PrincipalDecl = (FunctionTemplate
@@ -18679,19 +18679,19 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
18679
18679
RedeclarationKind::ForVisibleRedeclaration);
18680
18680
LookupName(Previous, S);
18681
18681
switch (Previous.getResultKind()) {
18682
- case LookupResult ::Found:
18683
- case LookupResult ::FoundUnresolvedValue:
18684
- PrevDecl = Previous.getAsSingle<NamedDecl>();
18685
- break;
18682
+ case LookupResultKind ::Found:
18683
+ case LookupResultKind ::FoundUnresolvedValue:
18684
+ PrevDecl = Previous.getAsSingle<NamedDecl>();
18685
+ break;
18686
18686
18687
- case LookupResult ::FoundOverloaded:
18688
- PrevDecl = Previous.getRepresentativeDecl();
18689
- break;
18687
+ case LookupResultKind ::FoundOverloaded:
18688
+ PrevDecl = Previous.getRepresentativeDecl();
18689
+ break;
18690
18690
18691
- case LookupResult ::NotFound:
18692
- case LookupResult ::NotFoundInCurrentInstantiation:
18693
- case LookupResult ::Ambiguous:
18694
- break;
18691
+ case LookupResultKind ::NotFound:
18692
+ case LookupResultKind ::NotFoundInCurrentInstantiation:
18693
+ case LookupResultKind ::Ambiguous:
18694
+ break;
18695
18695
}
18696
18696
Previous.suppressDiagnostics();
18697
18697
0 commit comments