Skip to content

Commit b0ac829

Browse files
committed
[clang][AST][NFC] const-qualify a few locals in isPlaceholderVar
1 parent 42e5214 commit b0ac829

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/AST/Decl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,11 +1088,11 @@ bool NamedDecl::isPlaceholderVar(const LangOptions &LangOpts) const {
10881088
return false;
10891089
if (isa<FieldDecl>(this))
10901090
return true;
1091-
if (auto *IFD = dyn_cast<IndirectFieldDecl>(this)) {
1091+
if (const auto *IFD = dyn_cast<IndirectFieldDecl>(this)) {
10921092
if (!getDeclContext()->isFunctionOrMethod() &&
10931093
!getDeclContext()->isRecord())
10941094
return false;
1095-
VarDecl *VD = IFD->getVarDecl();
1095+
const VarDecl *VD = IFD->getVarDecl();
10961096
return !VD || VD->getStorageDuration() == SD_Automatic;
10971097
}
10981098
// and it declares a variable with automatic storage duration
@@ -1105,7 +1105,7 @@ bool NamedDecl::isPlaceholderVar(const LangOptions &LangOpts) const {
11051105
}
11061106
if (const auto *BD = dyn_cast<BindingDecl>(this);
11071107
BD && getDeclContext()->isFunctionOrMethod()) {
1108-
VarDecl *VD = BD->getHoldingVar();
1108+
const VarDecl *VD = BD->getHoldingVar();
11091109
return !VD || VD->getStorageDuration() == StorageDuration::SD_Automatic;
11101110
}
11111111
return false;

0 commit comments

Comments
 (0)