From 4e07a13febc48298580660ef97661f02a238dabb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 10 Jan 2021 14:51:28 +0100 Subject: [PATCH] ClangImport: If typeIndex is negative we want to have Cppcheck warnings about that --- lib/clangimport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index b8c319d43..8eed21e58 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -392,7 +392,7 @@ std::string clangimport::AstNode::getSpelling() const if (typeIndex <= 0) return ""; } - const std::string &str = mExtTokens[std::max(typeIndex - 1, 0)]; + const std::string &str = mExtTokens[typeIndex - 1]; if (str.compare(0,4,"col:") == 0) return ""; if (str.compare(0,8,"