Fixed #10142 (FP uninitMemberVar with std::map)
This commit is contained in:
parent
0335671b35
commit
045f21ee48
|
@ -1955,7 +1955,7 @@ const Token * Variable::declEndToken() const
|
|||
{
|
||||
Token const * declEnd = typeStartToken();
|
||||
while (declEnd && !Token::Match(declEnd, "[;,)={]")) {
|
||||
if (declEnd->link() && Token::Match(declEnd,"(|["))
|
||||
if (declEnd->link() && Token::Match(declEnd,"(|[|<"))
|
||||
declEnd = declEnd->link();
|
||||
declEnd = declEnd->next();
|
||||
}
|
||||
|
|
|
@ -108,6 +108,7 @@ private:
|
|||
TEST_CASE(initvar_2constructors); // BUG 2270353
|
||||
TEST_CASE(initvar_constvar);
|
||||
TEST_CASE(initvar_staticvar);
|
||||
TEST_CASE(initvar_brace_init);
|
||||
TEST_CASE(initvar_union);
|
||||
TEST_CASE(initvar_delegate); // ticket #4302
|
||||
TEST_CASE(initvar_delegate2);
|
||||
|
@ -1046,6 +1047,19 @@ private:
|
|||
}
|
||||
|
||||
|
||||
void initvar_brace_init() { // #10142
|
||||
check("class C\n"
|
||||
"{\n"
|
||||
"public:\n"
|
||||
" C() {}\n"
|
||||
"\n"
|
||||
"private:\n"
|
||||
" std::map<int, double> * values_{};\n"
|
||||
"};");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
|
||||
void initvar_union() {
|
||||
check("class Fred\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue