File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -568,6 +568,7 @@ namespace {
568568 TokenList tokenlist (&s);
569569 std::istringstream istr (c);
570570 tokenlist.createTokens (istr, Standards::Language::C); // TODO: check result
571+ tokenlist.createAst ();
571572 for (const Token *tok = tokenlist.front (); tok; tok = tok->next ()) {
572573 if (tok->str () == " (" && tok->astOperand1 () && tok->astOperand2 ()) {
573574 // TODO: this is wrong - it is Contains() not Equals()
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class TestTokenList : public TestFixture {
4343 TEST_CASE (inc);
4444 TEST_CASE (isKeyword);
4545 TEST_CASE (notokens);
46+ TEST_CASE (ast1);
4647 }
4748
4849 // inspired by #5895
@@ -161,6 +162,15 @@ class TestTokenList : public TestFixture {
161162 TokenList tokenlist (&settingsDefault);
162163 tokenlist.createTokens (std::move (tokensP)); // do not assert
163164 }
165+
166+ void ast1 () {
167+ const std::string s = " ('Release|x64' == 'Release|x64');" ;
168+
169+ TokenList tokenlist (&settings);
170+ std::istringstream istr (s);
171+ tokenlist.createTokens (istr, Standards::Language::C);
172+ tokenlist.createAst (); // TODO: do not crash
173+ }
164174};
165175
166176REGISTER_TEST (TestTokenList)
You can’t perform that action at this time.
0 commit comments