Code below is rejected by 4.8.0. FWIW - it is accepted by clang32 and latest VC. ------------------------------------------------- template<class T> void f(T& t) {}; template<class T> void f(T&& t) {}; int main() { int lv{11}; f(lv); // error: ambigues overload } ---------------------------------------------
I can see the same problem with gcc 4.8.0 20120819 (experimental) (Let me add that the test example should remove the invalid semicolons after each function definition). This should be DR 1164: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1164
Already fixed on trunk. *** This bug has been marked as a duplicate of bug 57172 ***