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")
This commit is contained in:
chrchr-github 2022-09-29 13:29:50 +02:00 committed by GitHub
parent 33fde8ae6b
commit b8b6b41833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@
<define name="BOOST_PP_SEQ_TRANSFORM(macro, data, list)" value=""/>
<define name="BOOST_PP_CAT(a, b)" value=""/>
<define name="BOOST_PP_REPEAT(a,b,c)" value=""/>
<define name="BOOST_PP_STRINGIZE(t)" value=""/>
<!-- https://www.boost.org/doc/libs/master/doc/html/foreach.html -->
<define name="BOOST_FOREACH(A,B)" value="for (A: B)"/>
<!-- https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html -->
@ -92,6 +93,9 @@
<define name="BOOST_SCOPED_ENUM_DECLARE_BEGIN(x)" value=""/>
<define name="BOOST_SCOPED_ENUM_DECLARE_END(x)" value=""/>
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
<define name="BOOST_TTI_HAS_TYPE(x)" value=""/>
<define name="BOOST_TTI_MEMBER_TYPE(x)" value=""/>
<define name="BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(x)" value=""/>
<!-- ########## Boost containers ########## -->
<!-- boost containers that are similar to std containers -->
<container id="boostArray" startPattern="boost :: array|scoped_array &lt;" inherits="stdArray"/>

View File

@ -276,6 +276,7 @@
<define name="EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_LABEL_LEFT_CLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_LABEL_RIGHT_CLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_LEFT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_RIGHT_DCLICK(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_CHANGE(id,func)" value=""/>
<define name="EVT_GRID_CMD_CELL_CHANGED(id,func)" value=""/>

View File

@ -1517,6 +1517,7 @@ static Token * createAstAtToken(Token *tok, bool cpp)
}
if (!tok2 || tok2->str() != ";") {
if (tok2 == endPar && init1) {
createAstAtTokenInner(init1->next(), endPar, cpp);
tok->next()->astOperand2(init1);
tok->next()->astOperand1(tok);
}

View File

@ -5959,6 +5959,7 @@ private:
ASSERT_EQUALS("forae*bc.({:(", testAst("for (a *e : {b->c()});"));
ASSERT_EQUALS("fori0=iasize.(<i++;;( asize.(", testAst("for (decltype(a.size()) i = 0; i < a.size(); ++i);"));
ASSERT_EQUALS("foria:( asize.(", testAst("for(decltype(a.size()) i:a);"));
ASSERT_EQUALS("forec0{([,(:( fb.return", testAst("for (auto e : c(0, [](auto f) { return f->b; }));")); // #10802
// for with initializer (c++20)
ASSERT_EQUALS("forab=ca:;(", testAst("for(a=b;int c:a)"));