GCC Bugzilla – Bug 17447
Undetected incomplete types in parameters in templates
Last modified: 2004-11-17 00:23:44 UTC
struct B; template<typename T> struct A { friend A& operator <<(A& a, B b) { return a; } }; int main() { return 0; }
ICC 8.0 does not reject it (even in strict mode) but I think this is related or a dup of bug 16635.
The code is ill-formed, Comeau latest version rejects it. I have a patch for this.
Created attachment 7118 [details] Patch This does the trick, but requires full testing. I will take care of it in the following days (limited resources atm). If someone wants to help me testing this patch, go ahead.
A slightly revised patch was posted after testing: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01262.html
Updated patch: http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01312.html
Fixed for GCC 4.0, with this patch: http://gcc.gnu.org/ml/gcc-cvs/2004-11/msg00786.html Thanks for your report!