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

mail settings
Submitter Gabriel Dos Reis
Date Nov. 17, 2012, 4:50 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/199865/
State New
Headers show


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  <>

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


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;