[Bug c++/47861] static variables inside member functions

2011-02-24 Thread michal.t at tiscali dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47861 --- Comment #12 from Michal Turlik 2011-02-24 11:48:10 UTC --- Yep the Meyer singleton! T* instance() { static T instance; return &instance; } The trouble probably comes from this one...where the static definition comes from? Redi...I onl

[Bug c++/47861] static variables inside member functions

2011-02-24 Thread michal.t at tiscali dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47861 --- Comment #10 from Michal Turlik 2011-02-24 11:15:51 UTC --- redi, the signatures where wrong, the correct ones are: Base* Base::next (bool) void Base::init() btw you got the point - I mean you understood how the code buggy is. a better warn

[Bug c++/47861] static variables inside member functions

2011-02-24 Thread michal.t at tiscali dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47861 --- Comment #7 from Michal Turlik 2011-02-24 09:44:53 UTC --- Well guys it is probably silly but you need to consider a more specific case. Base* MyClass::next(bool reset) { static Bases::iterator it = m_bases.begin(); if(reset) it

[Bug c++/47861] New: static variables inside member functions

2011-02-23 Thread michal.t at tiscali dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47861 Summary: static variables inside member functions Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: trivial Priority: P3 Component: c++ AssignedTo: unassig...