------- Comment #10 from jwakely dot gcc at gmail dot com 2009-03-09 16:08 ------- reduced:
template <typename> struct x; template <typename> struct y { int x; }; template<typename T> bool operator<(const y<T>& l, const y<T>& r) { return l.x < r.x; } It doesn't happen except in a template context, so it seems that l.x< is parsed differently depending on whether it's inside a template or not. This is OK: template <typename> struct x; struct z { int x; }; bool operator<(const z& l, const z& r) { return l.x < r.x; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39407