re PR c++/44682 (warning: variable ‘x’ set but not used)
PR c++/44682 * class.c (build_base_path): If want_pointer, call mark_rvalue_use on expr. * g++.dg/warn/Wunused-var-14.C: New test. From-SVN: r161511
This commit is contained in:
parent
83377c6a3f
commit
7fd7263dc9
|
@ -1,3 +1,9 @@
|
||||||
|
2010-06-28 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/44682
|
||||||
|
* class.c (build_base_path): If want_pointer, call mark_rvalue_use
|
||||||
|
on expr.
|
||||||
|
|
||||||
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
|
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
* init.c: Do not include except.h.
|
* init.c: Do not include except.h.
|
||||||
|
|
|
@ -283,6 +283,8 @@ build_base_path (enum tree_code code,
|
||||||
if (!want_pointer)
|
if (!want_pointer)
|
||||||
/* This must happen before the call to save_expr. */
|
/* This must happen before the call to save_expr. */
|
||||||
expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error);
|
expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error);
|
||||||
|
else
|
||||||
|
mark_rvalue_use (expr);
|
||||||
|
|
||||||
offset = BINFO_OFFSET (binfo);
|
offset = BINFO_OFFSET (binfo);
|
||||||
fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
|
fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-06-28 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/44682
|
||||||
|
* g++.dg/warn/Wunused-var-14.C: New test.
|
||||||
|
|
||||||
2010-06-28 Tobias Burnus <burnus@net-b.de>
|
2010-06-28 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
PR fortran/43298
|
PR fortran/43298
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
// PR c++/44682
|
||||||
|
// { dg-do compile }
|
||||||
|
// { dg-options "-Wunused" }
|
||||||
|
|
||||||
|
struct S { virtual ~S () {} };
|
||||||
|
struct T { virtual ~T () {} };
|
||||||
|
struct U : S, T {};
|
||||||
|
|
||||||
|
void f (U &);
|
||||||
|
|
||||||
|
void
|
||||||
|
g (void *v)
|
||||||
|
{
|
||||||
|
T *t = static_cast <T *> (v);
|
||||||
|
U *u = static_cast <U *> (t);
|
||||||
|
f (*u);
|
||||||
|
}
|
Loading…
Reference in New Issue