From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31035 invoked by alias); 26 Nov 2013 04:14:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31016 invoked by uid 48); 26 Nov 2013 04:14:18 -0000 From: "eric.niebler at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59296] New: [c++11] ref-qualified member function is ambiguous Date: Tue, 26 Nov 2013 04:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eric.niebler at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02629.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59296 Bug ID: 59296 Summary: [c++11] ref-qualified member function is ambiguous Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eric.niebler at gmail dot com The following code fails to compile: struct S { constexpr int foo() const & { return 0; } constexpr int foo() const && { return 42; } }; int main() { constexpr int i =3D S{}.foo(); } The error I get is: $ /usr/local/gcc-4.8.2/bin/g++ -std=3Dgnu++11 -c test.cpp test.cpp: In function =E2=80=98int main()=E2=80=99: test.cpp:9:31: error: call of overloaded =E2=80=98foo()=E2=80=99 is ambiguo= us constexpr int i =3D S{}.foo(); ^ test.cpp:9:31: note: candidates are: test.cpp:3:19: note: constexpr int S::foo() const & constexpr int foo() const & { return 0; } ^ test.cpp:4:19: note: constexpr int S::foo() const && constexpr int foo() const && { return 42; } ^ The code in question is not ambiguous. The object is clearly an rvalue, so = the &&-qualified member should be preferred. >>From gcc-bugs-return-435853-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 26 04:24:03 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 3218 invoked by alias); 26 Nov 2013 04:24:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 3177 invoked by uid 48); 26 Nov 2013 04:23:55 -0000 From: "d.g.gorbachev at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/59179] [4.9 Regression] Wrong code generated with -Og Date: Tue, 26 Nov 2013 04:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: d.g.gorbachev at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02630.txt.bz2 Content-length: 465 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59179 Dmitry Gorbachev changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |WORKSFORME --- Comment #2 from Dmitry Gorbachev --- GCC 4.9.0 20131124 - works.