diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-21 07:47:13 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-21 07:47:13 +0000 |
commit | 79973b57881ed80335c998508bf71555e05c35d1 (patch) | |
tree | 42ffdc85ff34751f35f4783c71117e6304c80f6b /gcc/cp | |
parent | 2ab8f08d3d8b5a0413ebf1192b1ce519ed6fd588 (diff) | |
download | gcc-79973b57881ed80335c998508bf71555e05c35d1.tar.gz |
2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 16202
* c-typeck.c (lvalue_p): Move declaration ...
* c-common.h (lvalue_p): ... to here.
* c-common.c (candidate_equal_p): New.
(add_tlist): Use it.
(merge_tlist): Use it.
(warn_for_collisions_1): Likewise.
(warning_candidate_p): Accept more candidates.
(verify_tree): A warning candidate can be an expression. Use
candidate_equal_p.
cp/
* tree.c (lvalue_p_1): Use const_tree.
Use CONST_CAST_TREE to avoid warning.
(lvalue_p): Returns bool, receives const_tree.
testsuite/
* gcc.dg/sequence-pt-1.c: Remove XFAILs.
* gcc.dg/sequence-pt-2.c: New.
* gcc.dg/sequence-pt-3.c: New.
* g++.dg/warn/sequence-pt-1.C: Remove XFAILs.
* g++.dg/warn/sequence-pt-2.c: New.
* g++.dg/warn/sequence-pt-3.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146472 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/tree.c | 12 |
3 files changed, 14 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index df0a91a7f2b..c3374e37106 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org> + + PR 16202 + * tree.c (lvalue_p_1): Use const_tree. + Use CONST_CAST_TREE to avoid warning. + (lvalue_p): Returns bool, receives const_tree. + 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/13358 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index c80037d3419..d66e0de4775 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -5014,7 +5014,6 @@ extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); extern int lvalue_or_else (tree, enum lvalue_use, tsubst_flags_t); -extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index b4b977ef1a9..c95c11c4dde 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -44,7 +44,7 @@ static tree build_cplus_array_type_1 (tree, tree); static int list_hash_eq (const void *, const void *); static hashval_t list_hash_pieces (tree, tree, tree); static hashval_t list_hash (const void *); -static cp_lvalue_kind lvalue_p_1 (tree, int); +static cp_lvalue_kind lvalue_p_1 (const_tree, int); static tree build_target_expr (tree, tree); static tree count_trees_r (tree *, int *, void *); static tree verify_stmt_tree_r (tree *, int *, void *); @@ -59,7 +59,7 @@ static tree handle_init_priority_attribute (tree *, tree, tree, int, bool *); nonzero, rvalues of class type are considered lvalues. */ static cp_lvalue_kind -lvalue_p_1 (tree ref, +lvalue_p_1 (const_tree ref, int treat_class_rvalues_as_lvalues) { cp_lvalue_kind op1_lvalue_kind = clk_none; @@ -207,7 +207,9 @@ lvalue_p_1 (tree ref, case BASELINK: /* We now represent a reference to a single static member function with a BASELINK. */ - return lvalue_p_1 (BASELINK_FUNCTIONS (ref), + /* This CONST_CAST is okay because BASELINK_FUNCTIONS returns + its argument unmodified and we assign it to a const_tree. */ + return lvalue_p_1 (BASELINK_FUNCTIONS (CONST_CAST_TREE (ref)), treat_class_rvalues_as_lvalues); case NON_DEPENDENT_EXPR: @@ -251,8 +253,8 @@ real_lvalue_p (tree ref) /* This differs from real_lvalue_p in that class rvalues are considered lvalues. */ -int -lvalue_p (tree ref) +bool +lvalue_p (const_tree ref) { return (lvalue_p_1 (ref, /*class rvalue ok*/ 1) != clk_none); |