diff --git a/lib/checkother.cpp b/lib/checkother.cpp index a68f0dfdb..b9dbc4e9b 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1739,7 +1739,7 @@ void CheckOther::charBitOpError(const Token *tok) static bool isType(const Token * tok, bool unknown) { - if (tok && (tok->isStandardType() || (!tok->isKeyword() && Token::Match(tok, "%type%")))) + if (tok && (tok->isStandardType() || (!tok->isKeyword() && Token::Match(tok, "%type%")) || tok->str() == "auto")) return true; if (Token::simpleMatch(tok, "::")) return isType(tok->astOperand2(), unknown); diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index 37a017cde..98a1caa05 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -677,6 +677,11 @@ private: ASSERT_EQUALS("[test.cpp:2]: (warning, inconclusive) Found suspicious operator '+', result is not used.\n" "[test.cpp:5]: (warning, inconclusive) Found suspicious operator '+', result is not used.\n", errout.str()); + + check("void f(XMLElement& parent) {\n" // #11234 + " auto** elem = &parent.firstChild;\n" + "}\n", /*inconclusive*/ true); + ASSERT_EQUALS("", errout.str()); } void vardecl() {