* Fixed #8581 (Delegating contructor warns for unintialized variables) * Replace Token::Match with isStandardType
This commit is contained in:
parent
9b28499412
commit
42ed5a6b98
|
@ -5310,6 +5310,13 @@ void SymbolDatabase::setValueTypeInTokenList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function style cast
|
||||||
|
else if (tok->previous() && tok->previous()->isStandardType()) {
|
||||||
|
ValueType valuetype;
|
||||||
|
valuetype.type = ValueType::typeFromString(tok->previous()->str(), tok->previous()->isLong());
|
||||||
|
setValueType(tok, valuetype);
|
||||||
|
}
|
||||||
|
|
||||||
// library function
|
// library function
|
||||||
else if (tok->previous()) {
|
else if (tok->previous()) {
|
||||||
const std::string& typestr(_settings->library.returnValueType(tok->previous()));
|
const std::string& typestr(_settings->library.returnValueType(tok->previous()));
|
||||||
|
|
|
@ -1088,6 +1088,16 @@ private:
|
||||||
"\n"
|
"\n"
|
||||||
"A::A() noexcept: A(0) {}");
|
"A::A() noexcept: A(0) {}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// Ticket #8581
|
||||||
|
check("class A {\n"
|
||||||
|
"private:\n"
|
||||||
|
" int _a;\n"
|
||||||
|
"public:\n"
|
||||||
|
" A(int a) : _a(a) {}\n"
|
||||||
|
" A(float a) : A(int(a)) {}\n"
|
||||||
|
"};");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue