Skip to content

Commit 82fdd5b

Browse files
committed
[clang][NFC] Make parameters to NoteOverloadCandidate const
1 parent ae77ace commit 82fdd5b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4076,7 +4076,7 @@ class Sema final {
40764076

40774077
// Emit as a 'note' the specific overload candidate
40784078
void NoteOverloadCandidate(
4079-
NamedDecl *Found, FunctionDecl *Fn,
4079+
const NamedDecl *Found, const FunctionDecl *Fn,
40804080
OverloadCandidateRewriteKind RewriteKind = OverloadCandidateRewriteKind(),
40814081
QualType DestType = QualType(), bool TakingAddress = false);
40824082

clang/lib/Sema/SemaOverload.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10385,7 +10385,8 @@ enum OverloadCandidateSelect {
1038510385
};
1038610386

1038710387
static std::pair<OverloadCandidateKind, OverloadCandidateSelect>
10388-
ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
10388+
ClassifyOverloadCandidate(Sema &S, const NamedDecl *Found,
10389+
const FunctionDecl *Fn,
1038910390
OverloadCandidateRewriteKind CRK,
1039010391
std::string &Description) {
1039110392

@@ -10409,7 +10410,7 @@ ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
1040910410
if (CRK & CRK_Reversed)
1041010411
return oc_reversed_binary_operator;
1041110412

10412-
if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(Fn)) {
10413+
if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(Fn)) {
1041310414
if (!Ctor->isImplicit()) {
1041410415
if (isa<ConstructorUsingShadowDecl>(Found))
1041510416
return oc_inherited_constructor;
@@ -10428,7 +10429,7 @@ ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
1042810429
return oc_implicit_copy_constructor;
1042910430
}
1043010431

10431-
if (CXXMethodDecl *Meth = dyn_cast<CXXMethodDecl>(Fn)) {
10432+
if (const auto *Meth = dyn_cast<CXXMethodDecl>(Fn)) {
1043210433
// This actually gets spelled 'candidate function' for now, but
1043310434
// it doesn't hurt to split it out.
1043410435
if (!Meth->isImplicit())
@@ -10450,10 +10451,10 @@ ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,
1045010451
return std::make_pair(Kind, Select);
1045110452
}
1045210453

10453-
void MaybeEmitInheritedConstructorNote(Sema &S, Decl *FoundDecl) {
10454+
void MaybeEmitInheritedConstructorNote(Sema &S, const Decl *FoundDecl) {
1045410455
// FIXME: It'd be nice to only emit a note once per using-decl per overload
1045510456
// set.
10456-
if (auto *Shadow = dyn_cast<ConstructorUsingShadowDecl>(FoundDecl))
10457+
if (const auto *Shadow = dyn_cast<ConstructorUsingShadowDecl>(FoundDecl))
1045710458
S.Diag(FoundDecl->getLocation(),
1045810459
diag::note_ovl_candidate_inherited_constructor)
1045910460
<< Shadow->getNominatedBaseClass();
@@ -10560,7 +10561,7 @@ bool Sema::checkAddressOfFunctionIsAvailable(const FunctionDecl *Function,
1056010561

1056110562
// Don't print candidates other than the one that matches the calling
1056210563
// convention of the call operator, since that is guaranteed to exist.
10563-
static bool shouldSkipNotingLambdaConversionDecl(FunctionDecl *Fn) {
10564+
static bool shouldSkipNotingLambdaConversionDecl(const FunctionDecl *Fn) {
1056410565
const auto *ConvD = dyn_cast<CXXConversionDecl>(Fn);
1056510566

1056610567
if (!ConvD)
@@ -10580,7 +10581,7 @@ static bool shouldSkipNotingLambdaConversionDecl(FunctionDecl *Fn) {
1058010581
}
1058110582

1058210583
// 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,
1058410585
OverloadCandidateRewriteKind RewriteKind,
1058510586
QualType DestType, bool TakingAddress) {
1058610587
if (TakingAddress && !checkAddressOfCandidateIsAvailable(*this, Fn))

0 commit comments

Comments
 (0)