bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: c++: issue a warning with a value is moved several times


From: Akim Demaille
Subject: Re: RFC: c++: issue a warning with a value is moved several times
Date: Mon, 24 Sep 2018 08:50:56 +0200


> Le 23 sept. 2018 à 22:22, Frank Heckenbach <address@hidden> a écrit :
> 
> Akim Demaille wrote:
> 
>> I'm not sure about how the error message should be displayed.
>> At least, I think I should remove 'enabled'.
> 
> I think so, or alternatively "while ... [is] enabled".

Thanks.

I installed this:

commit e63bd2f25935ddafbc12f1f2087c113f84b81ca5
Author: Akim Demaille <address@hidden>
Date:   Mon Sep 24 08:49:00 2018 +0200

    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.

diff --git a/src/scan-code.l b/src/scan-code.l
index f692fc10..2b85d2c1 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; }
                                         ^^
 ]])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]