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++/59044] New: Internal compiler error triggers when accessing a typedef in a specialized member class


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

            Bug ID: 59044
           Summary: Internal compiler error triggers when accessing a
                    typedef in a specialized member class
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: decaluwe.t at gmail dot com

Created attachment 31180
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31180&action=edit
Preprocessor output

The following code triggers an internal compiler error when compiled with 'g++
bug.cpp' (the complete preprocessed file can be found in the attachment):

/* ---- bug.cpp --------------------------------------- */
template <class T>
class C {
private:
    template <T a, T b>
    struct Implementation;
    template <T b>
    struct Implementation<0, b> { typedef void Typedef; };
public:
    typedef typename Implementation<0, 0>::Typedef Type;
};

template class C<unsigned>;
/* ---------------------------------------------------- */

The error message produced by g++ 4.8.1 (as found in the g++-4.8 package in the
Ubuntu 13.10 repo, see below for build information):

bug.cpp: In instantiation of âclass C<unsigned int>â:
bug.cpp:12:16:   required from here
bug.cpp:9:52: internal compiler error: in tsubst, at cp/pt.c:11313
     typedef typename Implementation<0, 0>::Typedef Type;
                                                    ^

This bug is still present in the gcc-snapshot package. However the code
compiles fine in g++ 4.7.3 (as found in the g++-4.7 package).

Additional information:

GCC version: gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) 
System type: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.8.1-10ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu

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