diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg index 68957f1b8..4c367dda5 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Cpp/Cpp.stg @@ -510,6 +510,7 @@ LeftRecursiveRuleFunction(currentRule, args, code, locals, ruleCtx, altLabelCtxs size_t parentState = getState(); :: *_localctx = _tracker.createInstance\<\>(_ctx, parentState}>); :: *previousContext = _localctx; + (void)previousContext; // Silence compiler, in case the context is not used by generated code. size_t startState = ; enterRecursionRule(_localctx, , ::Rule, precedence);