4137 – conversion operator within template (original) (raw)
| I do not know whether this is a bug in the compiler or illegal code. The following program does not compile: template struct a { typedef int b; operator b(); }; template a::operator typename a::b() // omitting `typename' // makes no difference { return 0; } Workaround: template struct a { typedef int b; operator b() {return 0;} }; Without templates there is no problem: struct a { typedef int b; operator b(); }; a::operator a::b() { return 0; } Release: 3.0.1 Environment: SuSE 7.1 Comment 1 Nathan Sidwell 2002-02-26 14:16:48 UTC State-Changed-From-To: open->analyzed State-Changed-Why: confirmed Comment 2 Paolo Carlini 2003-01-02 13:33:45 UTC State-Changed-From-To: analyzed->closed State-Changed-Why: Already fixed for 3.3 and 3.4. | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |