public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57172] New: [C++11][DR 1164] Template overload resolution ambiguous for T&& versus T& Date: Sat, 04 May 2013 19:38:00 -0000 [thread overview] Message-ID: <bug-57172-4@http.gcc.gnu.org/bugzilla/> (raw) 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.
next reply other threads:[~2013-05-04 19:38 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-05-04 19:38 daniel.kruegler at googlemail dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-57172-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).