From: Richard Kenner Date: Fri, 23 Apr 1993 10:52:08 +0000 (-0400) Subject: (readonly_warning): Correctly check for assignments to iterators. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=550707f7e4c85d11b03510293626303d3395ebd4;p=gcc.git (readonly_warning): Correctly check for assignments to iterators. From-SVN: r4193 --- diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index bf2e56be6f6..624c6217700 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3446,11 +3446,10 @@ readonly_warning (arg, string) strcpy (buf, string); /* Forbid assignments to iterators. */ - if (TREE_CODE (TREE_OPERAND (arg, 0)) == VAR_DECL - && ITERATOR_P (TREE_OPERAND (arg, 0))) + if (TREE_CODE (arg) == VAR_DECL && ITERATOR_P (arg)) { strcat (buf, " of iterator `%s'"); - pedwarn (buf, IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1)))); + pedwarn (buf, IDENTIFIER_POINTER (DECL_NAME (arg))); } if (TREE_CODE (arg) == COMPONENT_REF)