The following code causes an ICE.  This code is certainly invalid as it stands,
though it is derived from something larger which I think is valid.

namespace SArray {

class ColumnMajor;

template <typename T, int rank> class Array;

}

template <typename T, int rank>
void xxx(const SArray::Array<T, rank> & arr)
{
    SArray::Array<T, rank> arr_contiguous = arr;
    arr_contiguous.force_ordering<typename SArray::ColumnMajor>();
}


Here is the compiler output:

% g++ -v test.cpp
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure --prefix=/usr/local/stow/gcc-4.0.2
Thread model: posix
gcc version 4.0.2
 /usr/local/stow/gcc-4.0.2/libexec/gcc/i686-pc-linux-gnu/4.0.2/cc1plus -quiet
-v -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=pentiumpro -auxbase
test -version -o /tmp/ccuyp00K.s
ignoring nonexistent directory
"/usr/local/stow/gcc-4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/stow/gcc-4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2

/usr/local/stow/gcc-4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/i686-pc-linux-gnu

/usr/local/stow/gcc-4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/backward
 /usr/local/include
 /usr/local/stow/gcc-4.0.2/include
 /usr/local/stow/gcc-4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/include
 /usr/include
End of search list.
GNU C++ version 4.0.2 (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.5 20050117 (prerelease) (SUSE Linux).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
test.cpp: In function âvoid xxx(const SArray::Array<T, rank>&)â:
test.cpp:13: internal compiler error: in make_typename_type, at cp/decl.c:2568
Please submit a full bug report,
with preprocessed source if appropriate.


-- 
           Summary: ICE in make_typename_type while parsing member template
                    invocation
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: holt-gcc at gholt dot net


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

Reply via email to