diff options
author | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2006-06-14 22:14:18 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2006-06-14 22:14:18 +0000 |
commit | decebe515433c392f5bf34105a538a5ee88c8640 (patch) | |
tree | 55538fd2aabed5476fd9633e8c3bbc5b09fb028b /gcc | |
parent | cf24598a2e455e30465a5c00f6be8b31fe8f7a79 (diff) | |
download | gcc-decebe515433c392f5bf34105a538a5ee88c8640.zip gcc-decebe515433c392f5bf34105a538a5ee88c8640.tar.gz gcc-decebe515433c392f5bf34105a538a5ee88c8640.tar.bz2 |
* typeck.c (build_modify_expr): Tidy diagnostic message.
From-SVN: r114658
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b0fc888..f8721f7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 5602ef2..d50c08b 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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; } |