File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -136,16 +136,14 @@ void ConstCorrectnessCheck::check(const MatchFinder::MatchResult &Result) {
136136 return ;
137137
138138 VariableCategory VC = VariableCategory::Value;
139- if (Variable->getType ()->isReferenceType ())
139+ const QualType VT = Variable->getType ();
140+ if (VT->isReferenceType ())
140141 VC = VariableCategory::Reference;
141- if (Variable-> getType () ->isPointerType ())
142+ else if (VT ->isPointerType ())
142143 VC = VariableCategory::Pointer;
143- if (Variable->getType ()->isArrayType ()) {
144- if (const auto *ArrayT = dyn_cast<ArrayType>(Variable->getType ())) {
145- if (ArrayT->getElementType ()->isPointerType ())
146- VC = VariableCategory::Pointer;
147- }
148- }
144+ else if (const auto *ArrayT = dyn_cast<ArrayType>(VT))
145+ if (ArrayT->getElementType ()->isPointerType ())
146+ VC = VariableCategory::Pointer;
149147
150148 // Each variable can only be in one category: Value, Pointer, Reference.
151149 // Analysis can be controlled for every category.
You can’t perform that action at this time.
0 commit comments