
Hartmut Kaiser wrote:
You should, if you (or someone) can confirm it happens on Intel 11.0 also. Here is a simple repro:
namespace N { struct S {}; template<class T, class U> void operator+(T const &, U const &) {} }
template<class T> struct X {}; struct Y : X<N::S> {};
int main() { Y y; y+y; }
The above code compiles with gcc but doesn't with Intel 10.1
Intel 11.0 (Windows):
t.cpp t.cpp(13): error: no operator "+" matches these operands operand types are: Y + Y y+y; ^
Thanks Hartmut. I checked the standard, and this appears to be correct behavior. That means that gcc's ADL is overeager. I've filed the bug here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38242 FWIW, MSVC also rejects this code. Thanks, -- Eric Niebler BoostPro Computing http://www.boostpro.com