[Bug c++/41134] [4.5 regression] Variable flagged unused if only used in template function
bangerth at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 20 21:20:00 GMT 2009
------- 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 remove it and without further changes the program is still
> valid or if we want to detect more elaborate cases where the programmer
> can remove a variable with some extra work.
Right, and I don't have the answer. All I'm saying is: this is, in a nutshell,
one of the header files of the threading building blocks. I used to be able
to compile my program with that file included with -W -Wunused and not get
a warning, but now I do get a warning if I happen to not use the template
function that is defined in the header file.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41134
More information about the Gcc-bugs
mailing list