Skip to content

Commit 30d0850

Browse files
committed
[clang][NFC] Improve const-correctness in ParseLexedMethodDeclaration
1 parent 8c5e487 commit 30d0850

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Parse/ParseCXXInlineMethods.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,14 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
466466
ConsumeAnyToken();
467467
} else if (HasUnparsed) {
468468
assert(Param->hasInheritedDefaultArg());
469-
const FunctionDecl *Old;
469+
FunctionDecl *Old;
470470
if (const auto *FunTmpl = dyn_cast<FunctionTemplateDecl>(LM.Method))
471471
Old =
472472
cast<FunctionDecl>(FunTmpl->getTemplatedDecl())->getPreviousDecl();
473473
else
474474
Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl();
475475
if (Old) {
476-
ParmVarDecl *OldParam = const_cast<ParmVarDecl*>(Old->getParamDecl(I));
476+
ParmVarDecl *OldParam = Old->getParamDecl(I);
477477
assert(!OldParam->hasUnparsedDefaultArg());
478478
if (OldParam->hasUninstantiatedDefaultArg())
479479
Param->setUninstantiatedDefaultArg(

0 commit comments

Comments
 (0)