This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/39205] Warning when object syntax is used to call a static member function
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2009 15:48:42 -0000
- Subject: [Bug c++/39205] Warning when object syntax is used to call a static member function
- References: <bug-39205-17315@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from sebor at roguewave dot com 2009-02-17 15:48 -------
(In reply to comment #0)
> I can't think of a scenario where one would want to write x.f() over X::f()
> when f() is static. I'd like a warning for this so I can catch with -Werror.
FWIW, I've seen x.y when y is a static data member of x in cases such as:
extern std::ostream x;
x.setf (x.showpos);
i.e., instead of spelling showpos as "std::ios::showpos." I can envision
similar cases where y is a static member function of the class, such as
std::ios::sync_with_stdio():
x.sync_with_stdio (false);
While I appreciate the desire to find such cases I'm not sure a warning
is the appropriate mechanism.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39205