Skip to content

Commit 7d42a2f

Browse files
committed
Const correctness
1 parent 8e1c675 commit 7d42a2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang-tools-extra/clang-tidy/modernize/UseConcisePreprocessorDirectivesCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace {
1818

1919
class IfPreprocessorCallbacks final : public PPCallbacks {
2020
public:
21-
IfPreprocessorCallbacks(ClangTidyCheck &Check, Preprocessor &PP)
21+
IfPreprocessorCallbacks(ClangTidyCheck &Check, const Preprocessor &PP)
2222
: Check(Check), PP(PP) {}
2323

2424
void If(SourceLocation Loc, SourceRange ConditionRange,
@@ -36,7 +36,7 @@ class IfPreprocessorCallbacks final : public PPCallbacks {
3636
private:
3737
void impl(SourceLocation DirectiveLoc, SourceRange ConditionRange,
3838
const llvm::StringLiteral (&Replacements)[2]) {
39-
StringRef Condition =
39+
const StringRef Condition =
4040
Lexer::getSourceText(CharSourceRange::getTokenRange(ConditionRange),
4141
PP.getSourceManager(), PP.getLangOpts());
4242
Lexer Lex(DirectiveLoc, PP.getLangOpts(), Condition.data(),
@@ -73,7 +73,7 @@ class IfPreprocessorCallbacks final : public PPCallbacks {
7373

7474
if (Tok.isNot(tok::TokenKind::raw_identifier))
7575
return;
76-
StringRef Macro = Tok.getRawIdentifier();
76+
const StringRef Macro = Tok.getRawIdentifier();
7777

7878
while (!NoMoreTokens) {
7979
NoMoreTokens = Lex.LexFromRawLexer(Tok);

0 commit comments

Comments
 (0)