From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25771 invoked by alias); 26 Apr 2013 05:05:54 -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 25727 invoked by uid 48); 26 Apr 2013 05:05:50 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57064] [clarification requested] Which overload with ref-qualifier should be called? Date: Fri, 26 Apr 2013 05:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg02131.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57064 --- Comment #13 from Marc Glisse 2013-04-26 05:05:48 UTC --- Note for Thiago: please be aware of the risks of returning an rvalue reference, as opposed to just a value. The following codes will fail at runtime: Qstring const& a=QString("%1 %2 %3 %4").arg(42).arg(47).arg(-42).arg(-47); Qstring && b=QString("%1 %2 %3 %4").arg(42).arg(47).arg(-42).arg(-47); for(char c : QString("%1 %2 %3 %4").arg(42).arg(47).arg(-42).arg(-47))...