Skip to content

Commit d9a50a6

Browse files
committed
fix review
1 parent ba27705 commit d9a50a6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "clang/AST/ASTContext.h"
1414
#include "clang/ASTMatchers/ASTMatchFinder.h"
1515
#include "clang/ASTMatchers/ASTMatchers.h"
16-
#include "llvm/Support/Casting.h"
1716
#include <cassert>
1817

1918
using namespace clang::ast_matchers;
@@ -157,13 +156,14 @@ void ConstCorrectnessCheck::check(const MatchFinder::MatchResult &Result) {
157156

158157
VariableCategory VC = VariableCategory::Value;
159158
const QualType VT = Variable->getType();
160-
if (VT->isReferenceType())
159+
if (VT->isReferenceType()) {
161160
VC = VariableCategory::Reference;
162-
else if (VT->isPointerType())
161+
} else if (VT->isPointerType()) {
163162
VC = VariableCategory::Pointer;
164-
else if (const auto *ArrayT = dyn_cast<ArrayType>(VT))
163+
} else if (const auto *ArrayT = dyn_cast<ArrayType>(VT)) {
165164
if (ArrayT->getElementType()->isPointerType())
166165
VC = VariableCategory::Pointer;
166+
}
167167

168168
auto CheckValue = [&]() {
169169
// The scope is only registered if the analysis shall be run.

clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ Options
113113
.. option:: AnalyzePointers
114114

115115
Enable or disable the analysis of pointers variables, like
116-
``int *ptr = &i;``. For specific checks, see options
117-
`WarnPointersAsValues` and `WarnPointersAsPointers`.
116+
``int *ptr = &i;``. For specific checks, see
117+
:option:`WarnPointersAsValues` and :option:`WarnPointersAsPointers`.
118118
Default is `true`.
119119

120120
.. option:: WarnPointersAsValues

0 commit comments

Comments
 (0)