aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2024-05-17 16:40:56 +0300
committerVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2024-05-17 16:41:20 +0300
commitd3d5a30021b8df26ac4b2b01e659ab8487fb4080 (patch)
treeec1b9d66e735ca55bb0bd22bd27923aaeac158c9 /clang/lib/Parse/ParseDecl.cpp
parent502ccd81c6bcf913d2eddf9ed24496a9a634e808 (diff)
downloadllvm-d3d5a30021b8df26ac4b2b01e659ab8487fb4080.zip
llvm-d3d5a30021b8df26ac4b2b01e659ab8487fb4080.tar.gz
llvm-d3d5a30021b8df26ac4b2b01e659ab8487fb4080.tar.bz2
[clang][NFC] Remove `const_cast` from `ParseClassSpecifier`
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 6d02687..179564a 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2845,10 +2845,11 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
void Parser::ParseSpecifierQualifierList(
DeclSpec &DS, ImplicitTypenameContext AllowImplicitTypename,
AccessSpecifier AS, DeclSpecContext DSC) {
+ ParsedTemplateInfo TemplateInfo;
/// specifier-qualifier-list is a subset of declaration-specifiers. Just
/// parse declaration-specifiers and complain about extra stuff.
/// TODO: diagnose attribute-specifiers and alignment-specifiers.
- ParseDeclarationSpecifiers(DS, ParsedTemplateInfo(), AS, DSC, nullptr,
+ ParseDeclarationSpecifiers(DS, TemplateInfo, AS, DSC, nullptr,
AllowImplicitTypename);
// Validate declspec for type-name.
@@ -2927,7 +2928,7 @@ static bool isValidAfterIdentifierInDeclarator(const Token &T) {
/// other pieces of declspec after it, it returns true.
///
bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
- const ParsedTemplateInfo &TemplateInfo,
+ ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS, DeclSpecContext DSC,
ParsedAttributes &Attrs) {
assert(Tok.is(tok::identifier) && "should have identifier");
@@ -3489,7 +3490,7 @@ Parser::DiagnoseMissingSemiAfterTagDefinition(DeclSpec &DS, AccessSpecifier AS,
/// 'friend': [C++ dcl.friend]
/// 'constexpr': [C++0x dcl.constexpr]
void Parser::ParseDeclarationSpecifiers(
- DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo, AccessSpecifier AS,
+ DeclSpec &DS, ParsedTemplateInfo &TemplateInfo, AccessSpecifier AS,
DeclSpecContext DSContext, LateParsedAttrList *LateAttrs,
ImplicitTypenameContext AllowImplicitTypename) {
if (DS.getSourceRange().isInvalid()) {
@@ -7736,8 +7737,9 @@ void Parser::ParseParameterDeclarationClause(
Diag(ThisLoc, diag::err_requires_expr_explicit_object_parameter);
}
- ParseDeclarationSpecifiers(DS, /*TemplateInfo=*/ParsedTemplateInfo(),
- AS_none, DeclSpecContext::DSC_normal,
+ ParsedTemplateInfo TemplateInfo;
+ ParseDeclarationSpecifiers(DS, TemplateInfo, AS_none,
+ DeclSpecContext::DSC_normal,
/*LateAttrs=*/nullptr, AllowImplicitTypename);
DS.takeAttributesFrom(ArgDeclSpecAttrs);