[Bug c++/47861] static variables inside member functions
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 23 21:20:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47861
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-23 20:55:08 UTC ---
(In reply to comment #2)
> Yep a warning stating the similarity of a static member function variable to
> its counterpart as a static member would be appreciated...maybe when
> pedantic option is going to be used.
No no no!
pedantic is for warning about using GCC extensions, not for warning about
possible misunderstanding of the language.
> The issue is real, just consider how the static members/attributes need to
> be defined and how instead the static member function variables do not.
> Thanks.
I've never encountered anyone who is confused in this way. There is no such
thing as a "static member function variable" it is a function-scope static and
it has exactly the same semantics whether it is present in a member function or
a non-member function.
I don't see what providing definitions of static members has to do with it.
I don't see a need for a new warning here.
More information about the Gcc-bugs
mailing list