public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44682]  New: warning: variable ‘x’ set but not used
@ 2010-06-26 13:29 wouter dot vermaelen at scarlet dot be
  2010-06-28  0:32 ` [Bug c++/44682] [4.6 Regression] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wouter dot vermaelen at scarlet dot be @ 2010-06-26 13:29 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

> cat bug.ii
struct Base1 {
    virtual ~Base1() {}
};
struct Base2 {
    virtual ~Base2() {}
};
struct Foo : Base1, Base2 {};

void f(Foo&);

void g(void* v) {
    Base2* base = static_cast<Base2*>(v);
    Foo* foo = static_cast<Foo*>(base);
    f(*foo);
}


> g++ -Wall -c bug.ii
bug.ii: In function ‘void g(void*)’:
bug.ii:12:9: warning: variable ‘base’ set but not used
[-Wunused-but-set-variable]


I'm using SVN revision trunk@161411 on linux x86_64.


-- 
           Summary: warning: variable ‘x’ set but not used
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wouter dot vermaelen at scarlet dot be


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44682


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/44682] [4.6 Regression] warning: variable ‘x’ set but not used
  2010-06-26 13:29 [Bug c++/44682] New: warning: variable ‘x’ set but not used wouter dot vermaelen at scarlet dot be
@ 2010-06-28  0:32 ` pinskia at gcc dot gnu dot org
  2010-06-28  8:55 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-06-28  0:32 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 950 bytes --]



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-06-28 00:31 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2010-06-28 00:31:55
               date|                            |
            Summary|warning: variable ‘x’ set   |[4.6 Regression] warning:
                   |but not used                |variable ‘x’ set but not
                   |                            |used
   Target Milestone|---                         |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44682


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/44682] [4.6 Regression] warning: variable ‘x’ set but not used
  2010-06-26 13:29 [Bug c++/44682] New: warning: variable ‘x’ set but not used wouter dot vermaelen at scarlet dot be
  2010-06-28  0:32 ` [Bug c++/44682] [4.6 Regression] " pinskia at gcc dot gnu dot org
@ 2010-06-28  8:55 ` jakub at gcc dot gnu dot org
  2010-06-28 20:13 ` jakub at gcc dot gnu dot org
  2010-06-29 15:24 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-28  8:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-06-28 08:54 -------
Created an attachment (id=21021)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21021&action=view)
gcc46-pr44682.patch

Untested fix.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44682


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/44682] [4.6 Regression] warning: variable ‘x’ set but not used
  2010-06-26 13:29 [Bug c++/44682] New: warning: variable ‘x’ set but not used wouter dot vermaelen at scarlet dot be
  2010-06-28  0:32 ` [Bug c++/44682] [4.6 Regression] " pinskia at gcc dot gnu dot org
  2010-06-28  8:55 ` jakub at gcc dot gnu dot org
@ 2010-06-28 20:13 ` jakub at gcc dot gnu dot org
  2010-06-29 15:24 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-28 20:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-06-28 20:13 -------
Subject: Bug 44682

Author: jakub
Date: Mon Jun 28 20:12:31 2010
New Revision: 161511

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161511
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wunused-var-14.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44682


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/44682] [4.6 Regression] warning: variable ‘x’ set but not used
  2010-06-26 13:29 [Bug c++/44682] New: warning: variable ‘x’ set but not used wouter dot vermaelen at scarlet dot be
                   ` (2 preceding siblings ...)
  2010-06-28 20:13 ` jakub at gcc dot gnu dot org
@ 2010-06-29 15:24 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-29 15:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-06-29 15:24 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44682


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-29 15:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-26 13:29 [Bug c++/44682] New: warning: variable ‘x’ set but not used wouter dot vermaelen at scarlet dot be
2010-06-28  0:32 ` [Bug c++/44682] [4.6 Regression] " pinskia at gcc dot gnu dot org
2010-06-28  8:55 ` jakub at gcc dot gnu dot org
2010-06-28 20:13 ` jakub at gcc dot gnu dot org
2010-06-29 15:24 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).