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]

c++/3869: Segmentation fault on specialized outer template with inner member template.



>Number:         3869
>Category:       c++
>Synopsis:       Segmentation fault on specialized outer template with inner member template.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 29 13:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan H Lundquist
>Release:        3.0
>Organization:
>Environment:
cygwin
>Description:
/* On viewing report 3868, the file attachment doesn't seem to be working.  This is duplicative, with the code here: */

template<int flag>
struct Flag {
   template<typename T, typename U>
   struct Which {
      typedef T Result;
   };
};

template<>
struct Flag<0> {
   template<typename T, typename U>
   struct Which {
      typedef U Result;
   };
};

template<int flag, typename T, typename U>
struct Select {
   typedef typename Flag<flag>::Which<T, U>::Result Result;
};


typedef Select<1, int, long>::Result Int;
typedef Select<0, int, long>::Result Long;

Int i = 0;
Long j = 0;

/*
C:\MYDOCU~1\DEVELO~1\jhl\gcctest>gcc -v -save-temps gcctest.cpp
Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.0/specs
Configured with: /cygdrive/c/mydocu~1/downloads/gcc-3.0/configure
Thread model: single
gcc version 3.0
 /usr/local/lib/gcc-lib/i686-pc-cygwin/3.0/cpp0.exe -lang-c++ -D__GNUG__=3 -D__G
XX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MI
NOR__=0 -D__GNUC_PATCHLEVEL__=0 -D_X86_=1 -D_X86_=1 -Asystem=winnt -D__NO_INLINE
__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__
tune_i686__ -D__tune_pentiumpro__ -D__stdcall=__attribute__((__stdcall__)) -D__c
decl=__attribute__((__cdecl__)) -D_stdcall=__attribute__((__stdcall__)) -D_cdecl
=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386__ -D__i3
86 -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -isystem /usr/local/in
clude -idirafter /usr/include -idirafter /usr/include/w32api gcctest.cpp gcctest
.ii
GNU CPP version 3.0 (cpplib) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-cygwin
 /usr/local/include/g++-v3/backward
 /usr/local/lib/gcc-lib/i686-pc-cygwin/3.0/include
 /usr/include
 /usr/include/w32api
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-cygwin/3.0/cc1plus.exe -fpreprocessed gcctest.ii
 -quiet -dumpbase gcctest.cpp -version -o gcctest.s
GNU CPP version 3.0 (cpplib) (80386, BSD syntax)
GNU C++ version 3.0 (i686-pc-cygwin)
        compiled by GNU C version 3.0.
gcctest.cpp:23: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
*/


>How-To-Repeat:
Compile the above
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
>Unformatted:


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