public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18541] New: "using" fails to make name visible without qualification
@ 2004-11-18 12:16 igodard at pacbell dot net
  2004-11-18 12:26 ` [Bug c++/18541] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: igodard at pacbell dot net @ 2004-11-18 12:16 UTC (permalink / raw)
  To: gcc-bugs

#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

-- 
           Summary: "using" fails to make name visible without qualification
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/18541] "using" fails to make name visible without qualification
  2004-11-18 12:16 [Bug c++/18541] New: "using" fails to make name visible without qualification igodard at pacbell dot net
@ 2004-11-18 12:26 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-18 12:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-18 12:25 -------
Yes this is a bug in GCC, see PR 14258.

*** This bug has been marked as a duplicate of 14258 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2004-11-18 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-18 12:16 [Bug c++/18541] New: "using" fails to make name visible without qualification igodard at pacbell dot net
2004-11-18 12:26 ` [Bug c++/18541] " pinskia at gcc dot gnu dot org

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).