parent
0eabe0505b
commit
a62c3ea90e
|
@ -1739,7 +1739,7 @@ void CheckOther::charBitOpError(const Token *tok)
|
||||||
|
|
||||||
static bool isType(const Token * tok, bool unknown)
|
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;
|
return true;
|
||||||
if (Token::simpleMatch(tok, "::"))
|
if (Token::simpleMatch(tok, "::"))
|
||||||
return isType(tok->astOperand2(), unknown);
|
return isType(tok->astOperand2(), unknown);
|
||||||
|
|
|
@ -677,6 +677,11 @@ private:
|
||||||
ASSERT_EQUALS("[test.cpp:2]: (warning, inconclusive) Found suspicious operator '+', result is not used.\n"
|
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",
|
"[test.cpp:5]: (warning, inconclusive) Found suspicious operator '+', result is not used.\n",
|
||||||
errout.str());
|
errout.str());
|
||||||
|
|
||||||
|
check("void f(XMLElement& parent) {\n" // #11234
|
||||||
|
" auto** elem = &parent.firstChild;\n"
|
||||||
|
"}\n", /*inconclusive*/ true);
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void vardecl() {
|
void vardecl() {
|
||||||
|
|
Loading…
Reference in New Issue