From 4647aae72f33b8742eb42c1fb869ebd4fdbb3038 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 13 Jan 2020 14:54:02 +0000 Subject: [PATCH] Merge isVectorType() and getAs calls to silence clang static analyzer warning. NFCI. --- clang/lib/AST/ASTDiagnostic.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 8ff3cebb..c241041c 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -300,8 +300,7 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, // Give some additional info on vector types. These are either not desugared // or displaying complex __attribute__ expressions so add details of the // type and element count. - if (Ty->isVectorType()) { - const VectorType *VTy = Ty->getAs(); + if (const auto *VTy = Ty->getAs()) { std::string DecoratedString; llvm::raw_string_ostream OS(DecoratedString); const char *Values = VTy->getNumElements() > 1 ? "values" : "value"; -- 2.7.4