diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-25 17:11:37 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-25 17:11:37 +0000 |
| commit | ab6bb71403e003cd006220ed24f340436fc58b4e (patch) | |
| tree | 1f43cc1480d6fed656039fd8b9ad792166e521e4 /gcc/c-typeck.c | |
| parent | 352baa70189c521d2c52b11845fc93cd4ed15b36 (diff) | |
| download | ppe42-gcc-ab6bb71403e003cd006220ed24f340436fc58b4e.tar.gz ppe42-gcc-ab6bb71403e003cd006220ed24f340436fc58b4e.zip | |
PR c++/18001
* c-common.h (lvalue_use): Move here from c-ctypeck.c.
(lvalue_or_else): Declare.
* c-common.c (lvalue_or_else): Move here from c-typeck.c.
* c-typeck.c (lvalue_use): Remove.
(lvalue_or_else): Remove.
PR c++/18556
* toplev.c (check_global_declarations): Set DECL_IGNORED_P on
unemitted variables with static storage duration.
PR c++/18445
* class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
unknown_type as non matching. Tidy up.
* pt.c (build_non_dependent_expr): Do not build a
NON_DEPENDENT_EXPR for a VAR_DECL.
PR c++/18001
* cp-tree.h (lvalue_or_else): Remove declaration.
* tree.c (lvalue_or_else): Remove.
* typeck.c (build_unary_op): Adjust call to lvalue_or_else.
(build_modify_expr): Likewise.
PR c++/18625
* decl.c (duplicate_decls): Return error_mark_node on error, as
specified.
PR c++/18466
* decl.c (grokvardecl): Keep track of whether or not a there was
explicit qualification.
* name-lookup.c (set_decl_namespace): Complain about explicit
qualification of a name within its own namespace.
PR c++/18545
* typeck.c (check_return_expr): Robustify.
PR c++/18445
* g++.dg/template/crash28.C: Likewise.
PR c++/18001
* g++.dg/expr/unary2.C: Adjust lvalue messages.
* g++.dg/ext/lvaddr.C: Likewise.
* g++.dg/opt/pr7503-3.C: Likewise.
PR c++/18466
* g++.dg/parse/qualified3.C: New test.
* g++.old-deja/g++.other/friend7.C: Remove bogus qualification.
PR c++/18545
* g++.dg/expr/return1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91301 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
| -rw-r--r-- | gcc/c-typeck.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index c5401042b66..23ff80e10de 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -44,17 +44,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree-iterator.h" #include "tree-gimple.h" -/* Places where an lvalue, or modifiable lvalue, may be required. - Used to select diagnostic messages in lvalue_or_else and - readonly_error. */ -enum lvalue_use { - lv_assign, - lv_increment, - lv_decrement, - lv_addressof, - lv_asm -}; - /* Possible cases of implicit bad conversions. Used to select diagnostic messages in convert_for_assignment. */ enum impl_conv { @@ -109,7 +98,6 @@ static void add_pending_init (tree, tree); static void set_nonincremental_init (void); static void set_nonincremental_init_from_string (tree); static tree find_init_member (tree); -static int lvalue_or_else (tree, enum lvalue_use); static void readonly_error (tree, enum lvalue_use); static void record_maybe_used_decl (tree); @@ -2714,43 +2702,6 @@ lvalue_p (tree ref) return 0; } } - -/* Return nonzero if REF is an lvalue valid for this language; - otherwise, print an error message and return zero. USE says - how the lvalue is being used and so selects the error message. */ - -static int -lvalue_or_else (tree ref, enum lvalue_use use) -{ - int win = lvalue_p (ref); - - if (!win) - { - switch (use) - { - case lv_assign: - error ("invalid lvalue in assignment"); - break; - case lv_increment: - error ("invalid lvalue in increment"); - break; - case lv_decrement: - error ("invalid lvalue in decrement"); - break; - case lv_addressof: - error ("invalid lvalue in unary %<&%>"); - break; - case lv_asm: - error ("invalid lvalue in asm statement"); - break; - default: - gcc_unreachable (); - } - } - - return win; -} - /* Give an error for storing in something that is 'const'. */ |

