#include <ostream> template<typename ch = char, typename tr = std::char_traits<ch> > class buffer : public std::basic_streambuf<ch, tr> { virtual int_type overflow(int_type c = tr::eof()); virtual typename int_type overflow1(typename int_type c = tr::eof()); using std::basic_streambuf<ch, tr>::int_type; virtual int_type overflow2(int_type c = tr::eof()); virtual typename int_type overflow3(typename int_type c = tr::eof()); virtual std::basic_streambuf<ch, tr>::int_type overflow4( std::basic_streambuf<ch, tr>::int_type c = tr::eof()); virtual typename std::basic_streambuf<ch, tr>::int_type overflow5( typename std::basic_streambuf<ch, tr>::int_type c = tr::eof()); }; int main() { buffer<> b; } gets you: ~/ootbc/common/test/src$ g++ foo.cc foo.cc:5: error: `int_type' does not name a type foo.cc:5: error: (perhaps `typename std::basic_streambuf<_CharT, _Traits>::int_type' was intended) foo.cc:8: error: expected nested-name-specifier before "int_type" foo.cc:8: error: `int_type' does not name a type foo.cc:8: error: (perhaps `typename std::basic_streambuf<_CharT, _Traits>::int_type' was intended) foo.cc:13: error: `int_type' does not name a type foo.cc:13: error: (perhaps `typename std::basic_streambuf<_CharT, _Traits>::int_type' was intended) foo.cc:16: error: expected nested-name-specifier before "int_type" foo.cc:16: error: `int_type' does not name a type foo.cc:16: error: (perhaps `typename std::basic_streambuf<_CharT, _Traits>::int_type' was intended) foo.cc:19: error: ISO C++ forbids declaration of `int_type' with no type foo.cc:19: error: cannot declare member `std::basic_streambuf<_CharT, _Traits>::int_type' within `buffer<ch, tr>' foo.cc:19: error: expected `;' before "overflow4" As suggested in the error for "overflow" (good message BTW), the form used in "overflow5" works. But a "using" for the inherited name "int_type" does not make the name visible either directly (overflow2) or when tagged with "typename" (overflow 3). But the "using" doesn't complain either. If I can "using" it I should be able to "use" it :-) Ivan
Yes this is a bug in GCC, see PR 14258. *** This bug has been marked as a duplicate of 14258 ***