http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46731
Summary: GCC shouts "cannot call member function 'void a::g()' without object" if a is a dependent base class Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: schaub-johan...@web.de This code should compile just fine, but it fails with GCC struct a { void g() { } template<typename T> struct b : T { void f() { g(); } }; }; void f() { a::b<a> x; x.f(); } [...@host2 cpp]$ LC_ALL=C g++ main1.cpp main1.cpp: In member function 'void a::b<T>::f() [with T = a]': main1.cpp:9:7: instantiated from here main1.cpp:4:29: error: cannot call member function 'void a::g()' without object The reason for its validity has been discussed at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21008 and http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#515 .