public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41109]  New: [4.5 regression] Argument flagged as unused despite use in sizeof()
@ 2009-08-18 18:39 bangerth at gmail dot com
  2009-08-20 20:41 ` [Bug c++/41109] " bangerth at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bangerth at gmail dot com @ 2009-08-18 18:39 UTC (permalink / raw)
  To: gcc-bugs

I think this is a recent regression:
-----------------------------
int memory_consumption(const int &t) { return sizeof(t); }

int s;
int g() { return memory_consumption(s); }
-----------------------------

deal.II> c++ -c -W -Wunused ../x.cc
../x.cc:1:5: warning: unused parameter 't'

Quite formally, it is probably correct to say that the parameter is unused
because we don't read or write from/to it. But I think it's still a kind of
use to determine its size and the warning should be suppressed in my
opinion.

In the meantime, the warning can of course be trivially suppressed by
saying
  sizeof(int)
instead.

W.


-- 
           Summary: [4.5 regression] Argument flagged as unused despite use
                    in sizeof()
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at gmail dot com


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
@ 2009-08-20 20:41 ` bangerth at gmail dot com
  2009-08-21 21:46 ` jason at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at gmail dot com @ 2009-08-20 20:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bangerth at gmail dot com  2009-08-20 20:41 -------
Jason, might this be a result of your changes to used/unused variables?
W.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
  2009-08-20 20:41 ` [Bug c++/41109] " bangerth at gmail dot com
@ 2009-08-21 21:46 ` jason at gcc dot gnu dot org
  2009-08-21 21:47 ` jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-08-21 21:46 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-21 21:46:27
               date|                            |


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
                   ` (2 preceding siblings ...)
  2009-08-21 21:47 ` jason at gcc dot gnu dot org
@ 2009-08-21 21:47 ` jason at gcc dot gnu dot org
  2009-08-24 21:32 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-08-21 21:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jason at gcc dot gnu dot org  2009-08-21 21:46 -------
*** Bug 41110 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
  2009-08-20 20:41 ` [Bug c++/41109] " bangerth at gmail dot com
  2009-08-21 21:46 ` jason at gcc dot gnu dot org
@ 2009-08-21 21:47 ` jason at gcc dot gnu dot org
  2009-08-21 21:47 ` jason at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-08-21 21:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2009-08-21 21:47 -------
*** Bug 41134 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
                   ` (3 preceding siblings ...)
  2009-08-21 21:47 ` jason at gcc dot gnu dot org
@ 2009-08-24 21:32 ` jason at gcc dot gnu dot org
  2009-08-24 22:37 ` bangerth at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-08-24 21:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jason at gcc dot gnu dot org  2009-08-24 21:32 -------
Subject: Bug 41109

Author: jason
Date: Mon Aug 24 21:31:54 2009
New Revision: 151061

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151061
Log:
        PR c++/41109
        PR c++/41110
        PR c++/41134
        * cp-tree.h (DECL_ODR_USED): New macro.
        (struct lang_decl_base): Add odr_used flag.
        * decl.c (duplicate_decls): Propagate it.  Use it for error.
        * pt.c (register_specialization): Use it for error.
        * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
        (cp_write_global_declarations): Use it for error.
        (tree_used_ok): Remove.
        * cp-tree.h: Remove tree_used_ok.
        * call.c (build_call_a): Don't call it.
        * init.c (build_offset_ref): Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wunused-17.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/init.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
                   ` (4 preceding siblings ...)
  2009-08-24 21:32 ` jason at gcc dot gnu dot org
@ 2009-08-24 22:37 ` bangerth at gmail dot com
  2009-08-25 15:50 ` jsm28 at gcc dot gnu dot org
  2009-09-18  3:57 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at gmail dot com @ 2009-08-24 22:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bangerth at gmail dot com  2009-08-24 22:37 -------
Thanks a lot for the quick turnaround, Jason!


-- 


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
                   ` (5 preceding siblings ...)
  2009-08-24 22:37 ` bangerth at gmail dot com
@ 2009-08-25 15:50 ` jsm28 at gcc dot gnu dot org
  2009-09-18  3:57 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-08-25 15:50 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug c++/41109] [4.5 regression] Argument flagged as unused despite use in sizeof()
  2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
                   ` (6 preceding siblings ...)
  2009-08-25 15:50 ` jsm28 at gcc dot gnu dot org
@ 2009-09-18  3:57 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-09-18  3:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2009-09-18 03:57 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-09-18  3:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-18 18:39 [Bug c++/41109] New: [4.5 regression] Argument flagged as unused despite use in sizeof() bangerth at gmail dot com
2009-08-20 20:41 ` [Bug c++/41109] " bangerth at gmail dot com
2009-08-21 21:46 ` jason at gcc dot gnu dot org
2009-08-21 21:47 ` jason at gcc dot gnu dot org
2009-08-21 21:47 ` jason at gcc dot gnu dot org
2009-08-24 21:32 ` jason at gcc dot gnu dot org
2009-08-24 22:37 ` bangerth at gmail dot com
2009-08-25 15:50 ` jsm28 at gcc dot gnu dot org
2009-09-18  3:57 ` pinskia 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).