C++ PATCH: tidy diagnostic about invalid of use of automatic variable

Submitted by Gabriel Dos Reis on Nov. 17, 2012, 4:50 p.m.


Message ID 87lie0fa1h.fsf@gauss.cs.tamu.edu
State New
Headers show

Commit Message

Gabriel Dos Reis Nov. 17, 2012, 4:50 p.m.
Now that we can actually declare a variable as `auto', it becomes
important to be precise in our terminology when diagnosing invalid
uses of variables with automatic storage -- especially if the variable
isn't declared 'auto'.

Applied to trunk.

-- Gaby

2012-11-17  Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* semantics.c (finish_id_expression): Tidy diagnostic message.

Patch hide | download patch | download mbox

Index: semantics.c
--- semantics.c	(revision 193586)
+++ semantics.c	(working copy)
@@ -3041,7 +3041,7 @@ 
 	      error (TREE_CODE (decl) == VAR_DECL
-		     ? G_("use of %<auto%> variable from containing function")
+		     ? G_("use of local variable with automatic storage from containing function")
 		     : G_("use of parameter from containing function"));
 	      error ("  %q+#D declared here", decl);
 	      return error_mark_node;