[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-24 Thread jason at gcc dot gnu dot org
--- Comment #8 from jason at gcc dot gnu dot org 2009-08-24 21:32 --- Subject: Bug 41134 Author: jason Date: Mon Aug 24 21:31:54 2009 New Revision: 151061 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=151061 Log: PR c++/41109 PR c++/41110 PR c++/41134

[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-21 Thread jason at gcc dot gnu dot org
--- Comment #7 from jason at gcc dot gnu dot org 2009-08-21 21:47 --- *** This bug has been marked as a duplicate of 41109 *** -- jason at gcc dot gnu dot org changed: What|Removed |Added

[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-20 Thread bangerth at gmail dot com
--- Comment #2 from bangerth at gmail dot com 2009-08-20 20:47 --- (In reply to comment #1) Well this is invalid code that is accepted by GCC anyways How so?? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41134

[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-20 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2009-08-20 20:49 --- You cannot use a static variable in a template :). Note the following is valid though: namespace { int i; } template typename int f() { return i; } And still invokes the warning: t4.cc:1:17: warning: 'unnamed::i'

[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-20 Thread bangerth at gmail dot com
--- Comment #4 from bangerth at gmail dot com 2009-08-20 20:54 --- (In reply to comment #3) You cannot use a static variable in a template :). I would be unaware of that restriction. It's true that you can't use objects with internal linkage (such as static variables) as *template

[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-20 Thread rguenth at gcc dot gnu dot org
--- Comment #5 from rguenth at gcc dot gnu dot org 2009-08-20 21:11 --- Why is this a regression? Which compiler version didn't warn here? The question is really whether we want unused variables just in the case where we can remove it and without further changes the program is still

[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function

2009-08-20 Thread bangerth at gmail dot com
--- Comment #6 from bangerth at gmail dot com 2009-08-20 21:20 --- (In reply to comment #5) Why is this a regression? Which compiler version didn't warn here? 4.3.2. Current mainline warns. The question is really whether we want unused variables just in the case where we can