aboutsummaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2024-05-17 17:15:06 +0300
committerVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2024-05-17 17:15:44 +0300
commit30d0850e0f780b17a37522e6503c98ebe197c5fa (patch)
treee6f4991ec30c7af7abfbfc6a0be98a5609479556 /clang
parent8c5e487ee3160cf4d40c0680ed40e4b0a494e956 (diff)
downloadllvm-30d0850e0f780b17a37522e6503c98ebe197c5fa.zip
llvm-30d0850e0f780b17a37522e6503c98ebe197c5fa.tar.gz
llvm-30d0850e0f780b17a37522e6503c98ebe197c5fa.tar.bz2
[clang][NFC] Improve const-correctness in `ParseLexedMethodDeclaration`
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index a26568d..943ce0f 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -466,14 +466,14 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
ConsumeAnyToken();
} else if (HasUnparsed) {
assert(Param->hasInheritedDefaultArg());
- const FunctionDecl *Old;
+ FunctionDecl *Old;
if (const auto *FunTmpl = dyn_cast<FunctionTemplateDecl>(LM.Method))
Old =
cast<FunctionDecl>(FunTmpl->getTemplatedDecl())->getPreviousDecl();
else
Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl();
if (Old) {
- ParmVarDecl *OldParam = const_cast<ParmVarDecl*>(Old->getParamDecl(I));
+ ParmVarDecl *OldParam = Old->getParamDecl(I);
assert(!OldParam->hasUnparsedDefaultArg());
if (OldParam->hasUninstantiatedDefaultArg())
Param->setUninstantiatedDefaultArg(