fix #2887 (infinit loop with ( A::A(std::auto_ptr<X> e){} ))
This commit is contained in:
parent
57a51128a4
commit
2516aad31d
@ -1138,8 +1138,8 @@ void CheckStl::checkAutoPointer()
|
||||
{
|
||||
tok3 = tok3->next();
|
||||
}
|
||||
if (!tok3)
|
||||
continue;
|
||||
if (tok3)
|
||||
{
|
||||
tok3 = tok3->previous()->previous();
|
||||
if (Token::simpleMatch(tok3->previous(), "[ ] )"))
|
||||
{
|
||||
@ -1159,6 +1159,7 @@ void CheckStl::checkAutoPointer()
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
tok2 = tok2->next();
|
||||
}
|
||||
}
|
||||
|
@ -1424,6 +1424,9 @@ private:
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (error) Object pointed by an 'auto_ptr' is destroyed using operator 'delete'. You should not use 'auto_ptr' for pointers obtained with operator 'new[]'.\n", errout.str());
|
||||
|
||||
// ticket #1887 infinite loop
|
||||
check("A::A(std::auto_ptr<X> e){}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user