17327 – [3.3/3.4/4.0 Regression] use of `enumeral_type' in template type unification (original) (raw)
| Description Lars Hansen 2004-09-05 12:50:48 UTC 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': 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 #include using namespace std; ////////////////////////////////////////////////////////////////////// enum E { E0, E1 }; ////////////////////////////////////////////////////////////////////// template class A; template ostream& operator << (ostream& out, A a); template class A { friend ostream& operator << (ostream& out, A a); int mI; public: A(int i) { mI = i; } }; template ostream& operator << (ostream& out, A a) { out << a.mI; return out; } ////////////////////////////////////////////////////////////////////// int main() { A a = 5; cout << a << endl; A b = 4; cout << b << endl; system("Pause"); return 0; } Comment 1 Kriang Lerdsuwanakij 2004-09-06 14:27:22 UTC Confirmed. It has failed since GCC 3.0 - a regression to GCC 2.95.x. Comment 2 Giovanni Bajo 2004-09-06 14:41:45 UTC 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? Comment 3 Kriang Lerdsuwanakij 2004-09-06 17:16:16 UTC A simple testcase: enum E { E0, E1 }; template <class T,class U> class A {}; template void f(A<E,T>) {} template void f(A<int,E>); Comment 4 Mark Mitchell 2004-09-09 04:30:08 UTC Mine. Comment 7 Mark Mitchell 2004-09-14 00:44:30 UTC Fixed in GCC 3.4.3. | | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |