Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,6 @@ static bool iscpp11init_impl(const Token * const tok)
if (nameToken->isCpp11init() != Token::Cpp11init::UNKNOWN)
return nameToken->isCpp11init() == Token::Cpp11init::CPP11INIT;
nameToken = nameToken->previous();
if (nameToken && nameToken->str() == "," && Token::simpleMatch(nameToken->previous(), "} ,"))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 453058c
The tests from that still pass.

nameToken = nameToken->linkAt(-1);
}
if (!nameToken)
return false;
Expand Down
4 changes: 4 additions & 0 deletions test/testtokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8493,6 +8493,10 @@ class TestTokenizer : public TestFixture {
"{ } } {",
Token::Cpp11init::CPP11INIT);

testIsCpp11init("void f() { g([]() {}, { 1 }); }\n",
"{ 1",
Token::Cpp11init::CPP11INIT);

ASSERT_NO_THROW(tokenizeAndStringify("template<typename U> struct X {};\n" // don't crash
"template<typename T> auto f(T t) -> X<decltype(t + 1)> {}\n"));
ASSERT_EQUALS("[test.cpp:2:22]: (debug) auto token with no type. [autoNoType]\n", errout_str());
Expand Down
Loading