public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39205]  New: Warning when object syntax is used to call a static member function
@ 2009-02-16 17:24 pgrealis at yahoo-inc dot com
  2009-02-17 11:04 ` [Bug c++/39205] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pgrealis at yahoo-inc dot com @ 2009-02-16 17:24 UTC (permalink / raw)
  To: gcc-bugs

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.

% g++ --version
g++ (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% uname -a
Linux norway.corp.ukl.yahoo.com 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST
2006 x86_64 x86_64 x86_64 GNU/Linux


cat t1.cpp
struct X
{
    void foo() {}
    static void bar() {}
};

int main()
{
  X x;
  x.foo();
  X::bar();
  x.bar(); // *** I'd like a warning for this ***
}

g++ t1.cpp


-- 
           Summary: Warning when object syntax is used to call a static
                    member function
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pgrealis at yahoo-inc dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39205


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-17 15:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-16 17:24 [Bug c++/39205] New: Warning when object syntax is used to call a static member function pgrealis at yahoo-inc dot com
2009-02-17 11:04 ` [Bug c++/39205] " rguenth at gcc dot gnu dot org
2009-02-17 11:06 ` paolo dot carlini at oracle dot com
2009-02-17 11:21 ` pgrealis at yahoo-inc dot com
2009-02-17 11:32 ` paolo dot carlini at oracle dot com
2009-02-17 15:49 ` sebor at roguewave dot com
2009-02-17 15:51 ` paolo dot 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).