diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-06-04 20:42:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-06-04 20:42:42 +0200 |
commit | 16c821230be0a70133754e1101b5b053f48bbb69 (patch) | |
tree | 26596117c2d7cb1fd741bf199a5856a892f747f4 /gcc/cp | |
parent | 7d1f0f8a52db86fa860f131d32d23f1e72ecc93d (diff) | |
download | gcc-16c821230be0a70133754e1101b5b053f48bbb69.zip gcc-16c821230be0a70133754e1101b5b053f48bbb69.tar.gz gcc-16c821230be0a70133754e1101b5b053f48bbb69.tar.bz2 |
re PR c++/44362 (Bogus set-but-not-used warning)
PR c++/44362
* call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
with the same type, call mark_lvalue_use on both.
* c-c++-common/Wunused-var-10.c: New test.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r160289
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/call.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b2f6cd1..b949f5a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2010-06-04 Jakub Jelinek <jakub@redhat.com> + Jason Merrill <jason@redhat.com> + + PR c++/44362 + * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues + with the same type, call mark_lvalue_use on both. + 2010-06-03 Nathan Froyd <froydnj@codesourcery.com> * class.c (struct vtbl_init_data_s): Remove last_init field. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b9f1c7f..60cc4f2 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3839,6 +3839,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3, && same_type_p (arg2_type, arg3_type)) { result_type = arg2_type; + mark_lvalue_use (arg2); + mark_lvalue_use (arg3); goto valid_operands; } |