This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17890] New: segfault prepeding void to nested class constructor


Debian Linux.

uname -a:
---------
Linux 2.6.8-1-k7 #1 Mon Sep 13 23:56:00 EDT 2004 i686 GNU/Linux

gcc -v:
--------------
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-
languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --
mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-
dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --
without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-
debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian 20040401)

src.cpp:
------------
template <typename T>
struct B
{
  struct BB
  {
    BB ();
  };
};

template <typename T>
inline void B<T>::BB::BB ()
{
}

cmd line:
---------
g++ -c src.cpp

output:
-------
src.cpp:11: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

additional comments:
--------------------
Remove the 'void' return value from the nested class's constructor and it 
compiles okay, as expected. The constructor is currently declared 'inline' 
outside the body of the class. Move the constructor implementation inside the 
body of the class and gcc correctly reports:
src.cpp:6: error: return type specification for constructor invalid

-- 
           Summary: segfault prepeding void to nested class constructor
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jgibbs at bluearc dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]