Merge pull request #2836 from sigmasoldi3r/master

[C++ codegen] Fixed deprecation warning for CPP targets > 17
This commit is contained in:
Terence Parr 2020-09-11 08:49:39 -07:00 committed by GitHub
commit 2aafb7f143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -248,6 +248,7 @@ YYYY/MM/DD, github id, Full name, email
2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com
2020/04/07, deniskyashif, Denis Kyashif, denis.kyashif@gmail.com
2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com
2020/06/04, sigmasoldi3r, Pablo Blanco, pablobc.1995@gmail.com
2020/05/25, graknol, Sindre van der Linden, graknol@gmail.com
2020/05/31, d-markey, David Markey, dmarkey@free.fr
2020/06/02, cohomology, Kilian Kilger, kkilger AT gmail.com

View File

@ -464,7 +464,11 @@ RuleFunction(currentRule, args, code, locals, ruleCtx, altLabelCtxs, namedAction
<namedActions.init>
<locals; separator = "\n">
#if __cplusplus > 201703L
auto onExit = finally([=, this] {
#else
auto onExit = finally([=] {
#endif
<finallyAction>
exitRule();
});
@ -517,7 +521,11 @@ LeftRecursiveRuleFunction(currentRule, args, code, locals, ruleCtx, altLabelCtxs
<namedActions.init>
<! TODO: untested !> <locals; separator = "\n">
#if __cplusplus > 201703L
auto onExit = finally([=, this] {
#else
auto onExit = finally([=] {
#endif
<if (finallyAction)><finallyAction><endif>
unrollRecursionContexts(parentContext);
});