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++/13458] New: Segfault on recursive member template; maybe duplicate of 13289.


The bug did not occur if either the data member z of outer<i1> :: inner was
removed or if the local variable a was removed.

Maybe a duplicate of bug #13289.

The code is invalid as far as I know.

.ii file:
----------------
# 1 "templtest1.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "templtest1.cpp"
template<int i1> struct outer {
 template<int i2> struct inner;
};

template<int i1, int i2> struct outer<i1> :: inner {
 outer<i1>::inner<i2-1> z;
};

int main(void) {
 outer<5>::inner<10> a;
}
-----------

gcc output:
-----------
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-includ
ed-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i4
86-linux
Thread model: posix
gcc version 3.3.3 20031206 (prerelease) (Debian)
 /usr/lib/gcc-lib/i486-linux/3.3.3/cc1plus -E -D__GNUG__=3 -quiet -v
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SO
URCE templtest1.cpp templtest1.ii
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3
 /usr/include/c++/3.3/i486-linux
 /usr/include/c++/3.3/backward
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/3.3.3/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i486-linux/3.3.3/cc1plus -fpreprocessed templtest1.ii -quiet
-dumpbase templtest1.cpp -auxbase templtest1 -version -
o templtest1.s
GNU C++ version 3.3.3 20031206 (prerelease) (Debian) (i486-linux)
        compiled by GNU C version 3.3.3 20031206 (prerelease) (Debian).
GGC heuristics: --param ggc-min-expand=44 --param ggc-min-heapsize=27832
templtest1.cpp: In instantiation of `outer<5>::inner<10>':
templtest1.cpp:10:   instantiated from here
templtest1.cpp:5: 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.

-- 
           Summary: Segfault on recursive member template; maybe duplicate
                    of 13289.
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sander at 01-creations dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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