public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41110]  New: [4.5 regression] Wrong "unused variable" warning
@ 2009-08-18 18:56 bangerth at gmail dot com
  2009-08-20 20:41 ` [Bug c++/41110] " bangerth at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bangerth at gmail dot com @ 2009-08-18 18:56 UTC (permalink / raw)
  To: gcc-bugs

This would appear to be a recent regression:
----------------------------
template <int> struct X { static const int s = 2; };

template <typename T> int f() {
  const unsigned int dim = 2;
  return X<dim>::s;
}

template int f<int>();
-----------------------------

deal.II> c++ -c -W -Wunused x.cc
x.cc: In function 'int f() [with T = int]':
x.cc:8:21:   instantiated from here
x.cc:4:22: warning: unused variable 'dim'

'dim' is used here, it just is never read from or written to.

W.


-- 
           Summary: [4.5 regression] Wrong "unused variable" warning
           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=41110


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

* [Bug c++/41110] [4.5 regression] Wrong "unused variable" warning
  2009-08-18 18:56 [Bug c++/41110] New: [4.5 regression] Wrong "unused variable" warning bangerth at gmail dot com
@ 2009-08-20 20:41 ` bangerth at gmail dot com
  2009-08-21 21:47 ` jason at gcc dot gnu dot org
  2009-08-24 21:32 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ 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:40 -------
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=41110


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

* [Bug c++/41110] [4.5 regression] Wrong "unused variable" warning
  2009-08-18 18:56 [Bug c++/41110] New: [4.5 regression] Wrong "unused variable" warning bangerth at gmail dot com
  2009-08-20 20:41 ` [Bug c++/41110] " bangerth at gmail dot com
@ 2009-08-21 21:47 ` jason at gcc dot gnu dot org
  2009-08-24 21:32 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ 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 -------


*** This bug has been marked as a duplicate of 41109 ***


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c++/41110] [4.5 regression] Wrong "unused variable" warning
  2009-08-18 18:56 [Bug c++/41110] New: [4.5 regression] Wrong "unused variable" warning bangerth at gmail dot com
  2009-08-20 20:41 ` [Bug c++/41110] " bangerth at gmail dot com
  2009-08-21 21:47 ` jason at gcc dot gnu dot org
@ 2009-08-24 21:32 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-08-24 21:32 UTC (permalink / raw)
  To: gcc-bugs



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

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=41110


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

end of thread, other threads:[~2009-08-24 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-18 18:56 [Bug c++/41110] New: [4.5 regression] Wrong "unused variable" warning bangerth at gmail dot com
2009-08-20 20:41 ` [Bug c++/41110] " bangerth at gmail dot com
2009-08-21 21:47 ` jason at gcc dot gnu dot org
2009-08-24 21:32 ` jason 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).