#8509 Uniform initialization ignored for iterator
This commit is contained in:
parent
d8634ca2a9
commit
55983e2a0b
|
@ -138,7 +138,7 @@ void CheckStl::iterators()
|
|||
continue;
|
||||
|
||||
// the validIterator flag says if the iterator has a valid value or not
|
||||
bool validIterator = Token::Match(var->nameToken()->next(), "[(=:]");
|
||||
bool validIterator = Token::Match(var->nameToken()->next(), "[(=:{]");
|
||||
const Scope* invalidationScope = nullptr;
|
||||
|
||||
// The container this iterator can be used with
|
||||
|
|
|
@ -555,6 +555,14 @@ private:
|
|||
" }\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #8509 Uniform initialization ignored for iterator
|
||||
check("void f() {\n"
|
||||
" std::vector<int> ints;\n"
|
||||
" std::vector<int>::const_iterator iter {ints.cbegin()};\n"
|
||||
" std::cout << (*iter) << std::endl;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void dereference_break() { // #3644
|
||||
|
|
Loading…
Reference in New Issue