http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54376
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-25 20:04:55 UTC --- Are you sure EDG accepts it? Not the ICC 12.1 I have at hand... I think we want to ask Jason anyway - because I'm not at all sure it's a compiler bug, neither that it's easy to fix - and possibly resort to declaration + inline out of class for 4.7.x and maybe 4.8.x too. And an audit for the rest of the library. Bother. This works of course: template<class> struct x { template<class T> friend bool operator==(x<T>, x<T>); }; template<class T> bool operator==(x<T>, x<T>) { return false; } int main() { x<int> x1; x<double> x2; x1 == x1; x2 == x2; }