public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57172] New: [C++11][DR 1164] Template overload resolution ambiguous for T&& versus T&
@ 2013-05-04 19:38 daniel.kruegler at googlemail dot com
  2013-05-04 21:27 ` [Bug c++/57172] " glisse at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-05-04 19:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57172

             Bug #: 57172
           Summary: [C++11][DR 1164] Template overload resolution
                    ambiguous for T&& versus T&
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com


The following code is rejected by gcc 4.9.0 20130428 (experimental) using the
compiler flags

-std=c++11 -Wall -pedantic-errors

//-----------------------------
template<typename T> int f(T&){}
template<typename T> int f(T&&);
int i;
int j = f(i);
//-----------------------------

"main.cpp|4|error: call of overloaded 'f(int&)' is ambiguous|
 main.cpp|4|note: candidates are:|
 main.cpp|1|note: int f(T&) [with T = int]|
 main.cpp|2|note: int f(T&&) [with T = int&]|"

This example was relevant for

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1164

and the core language has been adapted to make it well-formed as described by
[temp.deduct.partial] p9 b1. The compiler should select the first overload
here.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-01-21 17:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-04 19:38 [Bug c++/57172] New: [C++11][DR 1164] Template overload resolution ambiguous for T&& versus T& daniel.kruegler at googlemail dot com
2013-05-04 21:27 ` [Bug c++/57172] " glisse at gcc dot gnu.org
2013-05-05  9:50 ` vlukas at gmx dot de
2013-05-05  9:53 ` paolo.carlini at oracle dot com
2013-06-08 13:01 ` redi at gcc dot gnu.org
2013-06-16 10:14 ` paolo.carlini at oracle dot com
2013-06-16 10:22 ` glisse at gcc dot gnu.org
2013-06-16 12:19 ` paolo.carlini at oracle dot com
2013-06-27 11:43 ` glisse at gcc dot gnu.org
2014-01-19 19:03 ` glisse at gcc dot gnu.org
2014-01-21 17:03 ` seezer+gcc at roath dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).