Bug 17447 - Undetected incomplete types in parameters in templates
: Undetected incomplete types in parameters in templates
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
: 3.4.0
: P2 normal
: 4.0.0
Assigned To: Giovanni Bajo
:
: accepts-invalid, patch
:
:
  Show dependency treegraph
 
Reported: 2004-09-13 00:48 UTC by Ivan Godard
Modified: 2004-11-17 00:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 2.95.3 3.0.4 3.2.3 3.3.3 3.4.0 4.0.0
Last reconfirmed: 2004-09-13 03:48:18


Attachments
Patch (2.40 KB, patch)
2004-09-13 03:50 UTC, Giovanni Bajo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Godard 2004-09-13 00:48:50 UTC
struct B;
template<typename T> struct A {
    friend
    A&  operator <<(A& a, B b) { return a; }
    };
int main() {
    return 0; }
Comment 1 Andrew Pinski 2004-09-13 01:09:40 UTC
ICC 8.0 does not reject it (even in strict mode) but I think this is related or
a dup of bug 16635.
Comment 2 Giovanni Bajo 2004-09-13 03:48:18 UTC
The code is ill-formed, Comeau latest version rejects it. I have a patch for 
this.
Comment 3 Giovanni Bajo 2004-09-13 03:50:33 UTC
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.
Comment 4 Giovanni Bajo 2004-09-13 14:55:12 UTC
A slightly revised patch was posted after testing:
http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01262.html
Comment 5 Giovanni Bajo 2004-11-16 13:33:35 UTC
Updated patch:
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01312.html
Comment 6 Giovanni Bajo 2004-11-17 00:23:44 UTC
Fixed for GCC 4.0, with this patch:
http://gcc.gnu.org/ml/gcc-cvs/2004-11/msg00786.html

Thanks for your report!