Skip to content

Commit b8b6b41

Browse files
Fix #10802 Broken AST lambda inside for loop (#4520)
* Fix #10802 Broken AST lambda inside for loop * Add some boost and wxwidget defines (on behalf of "david ingamells")
1 parent 33fde8a commit b8b6b41

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

cfg/boost.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<define name="BOOST_PP_SEQ_TRANSFORM(macro, data, list)" value=""/>
1717
<define name="BOOST_PP_CAT(a, b)" value=""/>
1818
<define name="BOOST_PP_REPEAT(a,b,c)" value=""/>
19+
<define name="BOOST_PP_STRINGIZE(t)" value=""/>
1920
<!-- https://www.boost.org/doc/libs/master/doc/html/foreach.html -->
2021
<define name="BOOST_FOREACH(A,B)" value="for (A: B)"/>
2122
<!-- https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html -->
@@ -92,6 +93,9 @@
9293
<define name="BOOST_SCOPED_ENUM_DECLARE_BEGIN(x)" value=""/>
9394
<define name="BOOST_SCOPED_ENUM_DECLARE_END(x)" value=""/>
9495
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
96+
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
97+
<define name="BOOST_TTI_MEMBER_TYPE(x)" value=""/>
98+
<define name="BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(x)" value=""/>
9599
<!-- ########## Boost containers ########## -->
96100
<!-- boost containers that are similar to std containers -->
97101
<container id="boostArray" startPattern="boost :: array|scoped_array &lt;" inherits="stdArray"/>

cfg/wxwidgets.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
<define name="EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id,func)" value=""/>
277277
<define name="EVT_GRID_CMD_LABEL_LEFT_CLICK(id,func)" value=""/>
278278
<define name="EVT_GRID_CMD_LABEL_RIGHT_CLICK(id,func)" value=""/>
279+
<define name="EVT_GRID_CMD_CELL_LEFT_DCLICK(id,func)" value=""/>
279280
<define name="EVT_GRID_CMD_CELL_RIGHT_DCLICK(id,func)" value=""/>
280281
<define name="EVT_GRID_CMD_CELL_CHANGE(id,func)" value=""/>
281282
<define name="EVT_GRID_CMD_CELL_CHANGED(id,func)" value=""/>

lib/tokenlist.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,7 @@ static Token * createAstAtToken(Token *tok, bool cpp)
15171517
}
15181518
if (!tok2 || tok2->str() != ";") {
15191519
if (tok2 == endPar && init1) {
1520+
createAstAtTokenInner(init1->next(), endPar, cpp);
15201521
tok->next()->astOperand2(init1);
15211522
tok->next()->astOperand1(tok);
15221523
}

test/testtokenize.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5959,6 +5959,7 @@ class TestTokenizer : public TestFixture {
59595959
ASSERT_EQUALS("forae*bc.({:(", testAst("for (a *e : {b->c()});"));
59605960
ASSERT_EQUALS("fori0=iasize.(<i++;;( asize.(", testAst("for (decltype(a.size()) i = 0; i < a.size(); ++i);"));
59615961
ASSERT_EQUALS("foria:( asize.(", testAst("for(decltype(a.size()) i:a);"));
5962+
ASSERT_EQUALS("forec0{([,(:( fb.return", testAst("for (auto e : c(0, [](auto f) { return f->b; }));")); // #10802
59625963

59635964
// for with initializer (c++20)
59645965
ASSERT_EQUALS("forab=ca:;(", testAst("for(a=b;int c:a)"));

0 commit comments

Comments
 (0)