This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING^2] [C/C++] PR c/4076 -Wunused doesn't warn about static function only called by itself
Nathan Sidwell <nathan@codesourcery.com> writes:
| Manuel López-Ibáñez wrote:
|
| > I could but I was not able to construct a case where it was necessary.
| > How can a static function make a scoped recursive call? Sorry my
| > knowledge of C++ is not so good.
|
| namespace { struct X { void Foo () { X::Foo (); }}}
|
| might just cut it.
I think the same would apply member functions of local classes, no?
| Yes I know anonymous namespaces are not quite the
| same as static, and I don't know if we'll check this, but it seems
| wise to copy the idiom you've introduced.
speaking of unnamed namespaces member being treated "static", a
regression was introduced recently where the compiler will reject use
of unnamed namespace members as template arguments.
-- Gaby