]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
parser.c (cp_parser_range_for): Remove the "unused variable" warning workaround.
authorRodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Mon, 17 Jan 2011 22:34:26 +0000 (22:34 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 17 Jan 2011 22:34:26 +0000 (17:34 -0500)
* parser.c (cp_parser_range_for): Remove the "unused variable" warning
workaround.

From-SVN: r168936

gcc/cp/ChangeLog
gcc/cp/parser.c

index e7b45b4830b4fe8a8780b5ac7ef030d339b9375f..2f858e062074f4edd1863f03db6e8eee30de4478 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-14  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
+
+       * parser.c (cp_parser_range_for): Remove the "unused variable" warning
+       workaround.
+
 2011-01-15  Giovanni Funchal  <gafunchal@gmail.com>
            Jonathan Wakely  <jwakely.gcc@gmail.com>
 
index 061e8cc7fee3c972ce8c760002c2ecb8dc9961ea..41f82ac47476208669baa717a5e4f41b8e95a6ef 100644 (file)
@@ -8760,15 +8760,6 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl)
 {
   tree stmt, range_expr;
 
-  /* If the variable from a range-for is not actually used, GCC would issue
-     "unused variable" warnings, and the user could do little to prevent them.
-     So we always mark it as used.  */
-  if (range_decl != error_mark_node)
-    {
-      TREE_USED (range_decl) = 1;
-      DECL_READ_P (range_decl) = 1;
-    }
-
   if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
     {
       bool expr_non_constant_p;