From cf4e3eecefaa051746d1cd97d6c854f6bfeeec19 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 24 Sep 2018 08:49:00 +0200 Subject: [PATCH] c++: fix warning message for automove * src/scan-code.l: Remove 'enabled'. Use only $k (numeric), even for named references, for clarity. * tests/c++.at: Adjust expectations. --- src/scan-code.l | 4 ++-- tests/c++.at | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scan-code.l b/src/scan-code.l index 266c7cb2..ed21d547 100644 --- a/src/scan-code.l +++ b/src/scan-code.l @@ -681,8 +681,8 @@ handle_action_dollar (symbol_list *rule, char *text, location dollar_loc) if (muscle_percent_define_ifdef ("api.value.automove") && sym->action_props.is_value_used) complain (&dollar_loc, Wother, - _("multiple occurrences of $%s with api.value.automove enabled"), - cp); + _("multiple occurrences of $%d with api.value.automove"), + n); sym->action_props.is_value_used = true; } break; diff --git a/tests/c++.at b/tests/c++.at index 67ce3ab6..8a3d2b00 100644 --- a/tests/c++.at +++ b/tests/c++.at @@ -211,13 +211,13 @@ exp: ]]) AT_BISON_CHECK([[-fcaret input.yy]], [0], [], -[[input.yy:16.33-34: warning: multiple occurrences of $2 with api.value.automove enabled [-Wother] +[[input.yy:16.33-34: warning: multiple occurrences of $2 with api.value.automove [-Wother] | "twice" exp { $$ = $2 + $2; } ^^ -input.yy:17.33-36: warning: multiple occurrences of $val with api.value.automove enabled [-Wother] +input.yy:17.33-36: warning: multiple occurrences of $2 with api.value.automove [-Wother] | "thrice" exp[val] { $$ = $2 + $val + $2; } ^^^^ -input.yy:17.40-41: warning: multiple occurrences of $2 with api.value.automove enabled [-Wother] +input.yy:17.40-41: warning: multiple occurrences of $2 with api.value.automove [-Wother] | "thrice" exp[val] { $$ = $2 + $val + $2; } ^^ ]])