public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16171] New: Problems when deriving from basic stream classes
@ 2004-06-24  7:24 mark at emantic dot co dot uk
  2004-06-24  8:39 ` [Bug c++/16171] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mark at emantic dot co dot uk @ 2004-06-24  7:24 UTC (permalink / raw)
  To: gcc-bugs

Deriving from basic stream classes fails when: 
The name of the derived class is the same as the base class except that it is 
in a different namespace. 
 
The problem can be demonstrated using the following example (test.cpp): 
 
include <iostream> 
 
namespace mar { 
 
    template <typename charT, 
        typename char_traitsT = std::char_traits<charT> > 
    class basic_iostream 
    :   public std::basic_iostream<charT, char_traitsT> { 
    public: 
        basic_iostream() 
        :   std::basic_iostream<charT, char_traitsT>(0) 
        { 
        } 
    }; 
} 
 
int 
main(int argc, char* argv[]) 
{ 
    mar::basic_iostream<char> strm; 
    return 0; 
} 
 
$ g++ test.cpp 
test.cpp: In instantiation of `mar::basic_iostream<char, 
std::char_traits<char> >': 
test.cpp:20:   instantiated from here 
test.cpp:8: internal error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
$ gcc -v 
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/specs 
Configured with: ../gcc-3.2.3/configure --prefix=/usr --enable-shared 
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld 
--verbose --target=i486-slackware-linux --host=i486-slackware-linux 
Thread model: posix 
gcc version 3.2.3 
 
This problem can be avoided by renaming the derived class to something other 
than basic_iostream.

-- 
           Summary: Problems when deriving from basic stream classes
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark at emantic dot co dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-slackware-linux
  GCC host triplet: i486-slackware-linux
GCC target triplet: i486-slackware-linux


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


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

end of thread, other threads:[~2005-09-13 15:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-24  7:24 [Bug c++/16171] New: Problems when deriving from basic stream classes mark at emantic dot co dot uk
2004-06-24  8:39 ` [Bug c++/16171] " pinskia at gcc dot gnu dot org
2004-06-24 14:17 ` reichelt at gcc dot gnu dot org
2004-06-25 13:52 ` [Bug c++/16171] [ABI] Problems with standard names in different namespaces bangerth at dealii dot org
2004-07-01 17:19 ` bkoz at gcc dot gnu dot org
2005-05-20 13:36 ` reichelt at gcc dot gnu dot org
2005-09-13 15:16 ` cvs-commit at gcc dot gnu dot org
2005-09-13 15:17 ` cvs-commit at gcc dot gnu dot org
2005-09-13 15:19 ` mmitchel 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).