@@ -10385,7 +10385,8 @@ enum OverloadCandidateSelect {
10385
10385
};
10386
10386
10387
10387
static std::pair<OverloadCandidateKind, OverloadCandidateSelect>
10388
- ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
10388
+ ClassifyOverloadCandidate(Sema &S, const NamedDecl *Found,
10389
+ const FunctionDecl *Fn,
10389
10390
OverloadCandidateRewriteKind CRK,
10390
10391
std::string &Description) {
10391
10392
@@ -10409,7 +10410,7 @@ ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
10409
10410
if (CRK & CRK_Reversed)
10410
10411
return oc_reversed_binary_operator;
10411
10412
10412
- if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(Fn)) {
10413
+ if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(Fn)) {
10413
10414
if (!Ctor->isImplicit()) {
10414
10415
if (isa<ConstructorUsingShadowDecl>(Found))
10415
10416
return oc_inherited_constructor;
@@ -10428,7 +10429,7 @@ ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
10428
10429
return oc_implicit_copy_constructor;
10429
10430
}
10430
10431
10431
- if (CXXMethodDecl *Meth = dyn_cast<CXXMethodDecl>(Fn)) {
10432
+ if (const auto *Meth = dyn_cast<CXXMethodDecl>(Fn)) {
10432
10433
// This actually gets spelled 'candidate function' for now, but
10433
10434
// it doesn't hurt to split it out.
10434
10435
if (!Meth->isImplicit())
@@ -10450,10 +10451,10 @@ ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
10450
10451
return std::make_pair(Kind, Select);
10451
10452
}
10452
10453
10453
- void MaybeEmitInheritedConstructorNote(Sema &S, Decl *FoundDecl) {
10454
+ void MaybeEmitInheritedConstructorNote(Sema &S, const Decl *FoundDecl) {
10454
10455
// FIXME: It'd be nice to only emit a note once per using-decl per overload
10455
10456
// set.
10456
- if (auto *Shadow = dyn_cast<ConstructorUsingShadowDecl>(FoundDecl))
10457
+ if (const auto *Shadow = dyn_cast<ConstructorUsingShadowDecl>(FoundDecl))
10457
10458
S.Diag(FoundDecl->getLocation(),
10458
10459
diag::note_ovl_candidate_inherited_constructor)
10459
10460
<< Shadow->getNominatedBaseClass();
@@ -10560,7 +10561,7 @@ bool Sema::checkAddressOfFunctionIsAvailable(const FunctionDecl *Function,
10560
10561
10561
10562
// Don't print candidates other than the one that matches the calling
10562
10563
// convention of the call operator, since that is guaranteed to exist.
10563
- static bool shouldSkipNotingLambdaConversionDecl(FunctionDecl *Fn) {
10564
+ static bool shouldSkipNotingLambdaConversionDecl(const FunctionDecl *Fn) {
10564
10565
const auto *ConvD = dyn_cast<CXXConversionDecl>(Fn);
10565
10566
10566
10567
if (!ConvD)
@@ -10580,7 +10581,7 @@ static bool shouldSkipNotingLambdaConversionDecl(FunctionDecl *Fn) {
10580
10581
}
10581
10582
10582
10583
// Notes the location of an overload candidate.
10583
- void Sema::NoteOverloadCandidate(NamedDecl *Found, FunctionDecl *Fn,
10584
+ void Sema::NoteOverloadCandidate(const NamedDecl *Found, const FunctionDecl *Fn,
10584
10585
OverloadCandidateRewriteKind RewriteKind,
10585
10586
QualType DestType, bool TakingAddress) {
10586
10587
if (TakingAddress && !checkAddressOfCandidateIsAvailable(*this, Fn))
0 commit comments