================ @@ -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:
Is this allowed by out current guidelines? This `else if` blocks contains 2 lines. I think this is rather fragile and can easily break in the future. 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