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

login
register
mail settings
Submitter Gabriel Dos Reis
Date Nov. 17, 2012, 4:50 p.m.
Message ID <87lie0fa1h.fsf@gauss.cs.tamu.edu>
Download mbox | patch
Permalink /patch/199865/
State New
Headers show

Comments

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

Index: semantics.c
===================================================================
--- semantics.c	(revision 193586)
+++ semantics.c	(working copy)
@@ -3041,7 +3041,7 @@ 
 	  else
 	    {
 	      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;