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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 17:19 UTC by Leonid Volnitsky
Modified: 2014-01-19 19:03 UTC (History)
2 users (show)

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


Attachments

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:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#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 ***