File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 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
1918using 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.
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments