Bug 54425 - Rvalue/Lvalue overload resolution of templated function
Summary: Rvalue/Lvalue overload resolution of templated function
Status: RESOLVED DUPLICATE of bug 57172
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2012-08-30 17:19 UTC by Leonid Volnitsky
Modified: 2014-01-19 19:03 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2012-10-06 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Volnitsky 2012-08-30 17:19:04 UTC
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
Comment 1 Daniel Krügler 2012-08-30 21:51:07 UTC
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:

Comment 2 Marc Glisse 2014-01-19 19:03:53 UTC
Already fixed on trunk.

*** This bug has been marked as a duplicate of bug 57172 ***