Version: -------- http://mesh.dl.sourceforge.net/sourceforge/mingw/gcc-core-3.4.1-20040711- 1.tar.gz Using built-in specs. Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host= mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable -languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --e nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-ja va-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchroniz ation --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.1 (mingw special) Compiler settings: ------------------ g++.exe "F:\Daten\Projekte\CPP\trainingGNU\templates.cpp" - o "F:\Daten\Projekte\CPP\trainingGNU\templates.exe" -I"C:\Dev- Cpp\include\c++\3.4.1" -I"C:\Dev-Cpp\include\c++\3.4.1\mingw32" -I"C:\Dev- Cpp\include\c++\3.4.1\backward" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.1\include" - I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" Messages: --------- F:\Daten\Projekte\CPP\trainingGNU\templates.cpp: In instantiation of `A<E>': F:\Daten\Projekte\CPP\trainingGNU\templates.cpp:47: instantiated from here F:\Daten\Projekte\CPP\trainingGNU\templates.cpp:24: sorry, unimplemented: use of `enumeral_type' in template type unification F:\Daten\Projekte\CPP\trainingGNU\templates.cpp:24: sorry, unimplemented: use of `enumeral_type' in template type unification F:\Daten\Projekte\CPP\trainingGNU\templates.cpp:24: sorry, unimplemented: use of `enumeral_type' in template type unification F:\Daten\Projekte\CPP\trainingGNU\templates.cpp:24: sorry, unimplemented: use of `enumeral_type' in template type unification F:\Daten\Projekte\CPP\trainingGNU\templates.cpp:24: sorry, unimplemented: use of `enumeral_type' in template type unification Problem: -------- The code can be compiled successfully with other compilers like Comeau or Borland BuilderX and runs proper. Source: ------- #include <iostream> #include <cstdlib> using namespace std; ////////////////////////////////////////////////////////////////////// enum E { E0, E1 }; ////////////////////////////////////////////////////////////////////// template <typename T> class A; template <typename T> ostream& operator << (ostream& out, A<T> a); template <typename T> class A { friend ostream& operator << <T> (ostream& out, A<T> a); int mI; public: A(int i) { mI = i; } }; template <typename T> ostream& operator << (ostream& out, A<T> a) { out << a.mI; return out; } ////////////////////////////////////////////////////////////////////// int main() { A<int> a = 5; cout << a << endl; A<E> b = 4; cout << b << endl; system("Pause"); return 0; }
Confirmed. It has failed since GCC 3.0 - a regression to GCC 2.95.x.
A reduced testcase is needed to analyze the bug, because it definetely has to do with some other operator<< for ostreams defined in the standard headers. Can anybody help?
A simple testcase: enum E { E0, E1 }; template <class T,class U> class A {}; template <class T> void f(A<E,T>) {} template void f(A<int,E>);
Mine.
Subject: Bug 17327 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2004-09-14 00:29:04 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog parser.c pt.c Added files: gcc/testsuite/g++.dg/parse: crash17.C gcc/testsuite/g++.dg/template: enum3.C Log message: PR c++/16716 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Robustify. PR c++/17327 * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with gcc_unreacable. PR c++/16716 * g++.dg/parse/crash17.C: New test. PR c++/17327 * g++.dg/template/enum3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4279&r2=1.4280 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4348&r2=1.4349 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.245&r2=1.246 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.921&r2=1.922 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash17.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/enum3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 17327 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: mmitchel@gcc.gnu.org 2004-09-14 00:44:06 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog pt.c Added files: gcc/testsuite/g++.dg/template: enum3.C Log message: PR c++/17327 * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with gcc_unreacable. PR c++/17327 * g++.dg/template/enum3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.266&r2=1.3389.2.267 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/enum3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.155&r2=1.3892.2.156 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.41&r2=1.816.2.42
Fixed in GCC 3.4.3.