================
@@ -136,16 +136,14 @@ void ConstCorrectnessCheck::check(const 
MatchFinder::MatchResult &Result) {
     return;
 
   VariableCategory VC = VariableCategory::Value;
-  if (Variable->getType()->isReferenceType())
+  const QualType VT = Variable->getType();
+  if (VT->isReferenceType())
     VC = VariableCategory::Reference;
-  if (Variable->getType()->isPointerType())
+  else if (VT->isPointerType())
     VC = VariableCategory::Pointer;
-  if (Variable->getType()->isArrayType()) {
-    if (const auto *ArrayT = dyn_cast<ArrayType>(Variable->getType())) {
-      if (ArrayT->getElementType()->isPointerType())
-        VC = VariableCategory::Pointer;
-    }
-  }
+  else if (const auto *ArrayT = dyn_cast<ArrayType>(VT))
----------------
carlosgalvezp wrote:

My reading of the 
[guidelines](https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements)
 is that we should use braces in the outer `if` if there is a nested `if`.

https://github.com/llvm/llvm-project/pull/130493
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to