]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* typeck.c (build_modify_expr): Tidy diagnostic message.
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Wed, 14 Jun 2006 22:14:18 +0000 (22:14 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Wed, 14 Jun 2006 22:14:18 +0000 (22:14 +0000)
From-SVN: r114658

gcc/cp/ChangeLog
gcc/cp/typeck.c

index b0fc888475f1d0842a3ae6aaa5e36084c83b2777..f8721f722028709d6b28d0f7cec97c122f5f3262 100644 (file)
@@ -1,3 +1,7 @@
+2006-06-14  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       * typeck.c (build_modify_expr): Tidy diagnostic message.
+
 2006-06-14  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/28018
index 5602ef2baa2c2ef26d62aa4ef1c79c283ca7f659..d50c08b0c7e35c70d65a5343e6ebbab012645dee 100644 (file)
@@ -5708,7 +5708,12 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
       /* Allow array assignment in compiler-generated code.  */
       if (! DECL_ARTIFICIAL (current_function_decl))
        {
-         error ("array used as initializer");
+          /* This routine is used for both initialization and assignment.
+             Make sure the diagnostic message differentiates the context.  */
+          if (modifycode == INIT_EXPR)
+            error ("array used as initializer");
+          else
+            error ("invalid array assignment");
          return error_mark_node;
        }