public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53711] New: Wunused-function should warn for functions in the unnamed namespace
@ 2012-06-17 19:51 david at doublewise dot net
2012-06-20 18:47 ` [Bug c++/53711] " daniel.kruegler at googlemail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: david at doublewise dot net @ 2012-06-17 19:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53711
Bug #: 53711
Summary: Wunused-function should warn for functions in the
unnamed namespace
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: david@doublewise.net
Wunused-function currently only warns for functions that are declared as static
that are never used / defined. It should also warn about functions placed in
the unnamed namespace, such as:
namespace {
void f();
}
Such functions have similar mechanics to static functions. In particular, they
can only be referenced in the translation unit, so the compiler knows for
certain that if the function is not used in this translation unit, it is not
used.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/53711] Wunused-function should warn for functions in the unnamed namespace
2012-06-17 19:51 [Bug c++/53711] New: Wunused-function should warn for functions in the unnamed namespace david at doublewise dot net
@ 2012-06-20 18:47 ` daniel.kruegler at googlemail dot com
2014-03-14 15:21 ` jason at gcc dot gnu.org
2015-03-24 13:41 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-06-20 18:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53711
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-06-20 18:46:53 UTC ---
I agree. For C++11 code there exists one further similarity, namely that f()
has static linkage like a function explicitly declared static in namespace
scope.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/53711] Wunused-function should warn for functions in the unnamed namespace
2012-06-17 19:51 [Bug c++/53711] New: Wunused-function should warn for functions in the unnamed namespace david at doublewise dot net
2012-06-20 18:47 ` [Bug c++/53711] " daniel.kruegler at googlemail dot com
@ 2014-03-14 15:21 ` jason at gcc dot gnu.org
2015-03-24 13:41 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2014-03-14 15:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53711
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Mar 14 15:20:28 2014
New Revision: 208569
URL: http://gcc.gnu.org/viewcvs?rev=208569&root=gcc&view=rev
Log:
PR c++/53711
* d++.dg/warn/anonymous-namespace-6.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/warn/anonymous-namespace-6.C
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/53711] Wunused-function should warn for functions in the unnamed namespace
2012-06-17 19:51 [Bug c++/53711] New: Wunused-function should warn for functions in the unnamed namespace david at doublewise dot net
2012-06-20 18:47 ` [Bug c++/53711] " daniel.kruegler at googlemail dot com
2014-03-14 15:21 ` jason at gcc dot gnu.org
@ 2015-03-24 13:41 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-24 13:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53711
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |4.9.0
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed then.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-24 13:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-17 19:51 [Bug c++/53711] New: Wunused-function should warn for functions in the unnamed namespace david at doublewise dot net
2012-06-20 18:47 ` [Bug c++/53711] " daniel.kruegler at googlemail dot com
2014-03-14 15:21 ` jason at gcc dot gnu.org
2015-03-24 13:41 ` paolo.carlini at oracle dot com
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).