gcc 2.95.2 ICE with templates

PETER NORDLUND peter_nordlund@swipnet.se
Mon Feb 21 13:50:00 GMT 2000


The code below generates an ICE under Cygwin 
20.1.
See bottom of mail for compilation 
output.
See also enclosed tar-file with some .ii and .s 
files
 
template <typename SINGLETON, typename 
MANAGER> class SingletonTraits { };
 
template <typename SINGLETON, typename 
MANAGER> class Singleton { public:   typedef typename 
    SingletonTraits<SINGLETON, 
MANAGER>::InstantiatorType InstantiatorType; };
 
class NoCleanupMgr2 {};
 
// Traits class // template <typename 
SINGLETON> struct SingletonTraits<SINGLETON, NoCleanupMgr2>  
{   typedef NoCleanupMgr2 InstantiatorType; };
 
class S: public Singleton<S, NoCleanupMgr2> 
{   friend class Singleton<S, NoCleanupMgr2>::InstantiatorType; // 
Line 20 };
 
int main(){   return 0; }
 
#if 0 src>>g++ bug2.cpp bug2.cpp:20: 
Internal compiler error. bug2.cpp:20: Please submit a full bug 
report. bug2.cpp:20: See < URL:http://www.gnu.org/software/gcc/faq.html#bugreport > 
for instructions. src>>uname -a CYGWIN_NT-4.0 LILY 20.1 (0.3/1/1) 
1998-12-3 20:39:18 i586 unknown src>>g++ -v Reading specs from file://F/ntprog/cygwin/gcc-2.95/install-2.95.2/H-i586-cygwin32/bin /../lib/gcc-lib/i586-cygwin32/2.95.2/specs gcc 
version 2.95.2 19991024 (release) #endif
Bug2.tgz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bug2.tgz
Type: application/x-gzip
Size: 1260 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000221/45a4766e/attachment.bin>


More information about the Gcc-bugs mailing list