From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19755 invoked by alias); 21 Oct 2014 21:07:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 19746 invoked by uid 89); 21 Oct 2014 21:07:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f49.google.com Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 21 Oct 2014 21:07:02 +0000 Received: by mail-oi0-f49.google.com with SMTP id a3so1642458oib.8 for ; Tue, 21 Oct 2014 14:07:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=sGOflMC5EHpqSEAYreQeIUhQQR1AOckwn4gTRWN4Bro=; b=Npcf+ce9Q2HGA9vlZrk2J3XEBTRmp2aPk3ikgIprWx288OY7ipWW4ulREJbysa7sth ud1eChFWK+g3XNi1y7cQOobcuktOC+sEHIw+BXbNK5BMlTuwyIKRrYRt2U7mVogM/jui 9tOjGxDUjyRy72ORfmCFsiypDsoGnhiz087YwT4UEUfNhn75IeIJ/dqqQMfuACBvCbjs taUMp5O0OG1Hg2yHJKbyL8D5bBpgIVPNltBxkCo8l93tVwlEPJ/t9faKvOXbKUeULZ7k pGPtqbNIy2aXxtQLPpuVnhWX+DVH0uMX9P3RCwog1Gd9VXdodisRWZNbnoOSZlsEnBIV htKw== X-Gm-Message-State: ALoCoQmhIrQh83BYlf5TrwYl3/ZWvGN5d3/PJmZjXpHWNDcQfhrKUvRAdJ7dPwCJA1UWodDkYEy1 MIME-Version: 1.0 X-Received: by 10.60.47.100 with SMTP id c4mr32598055oen.9.1413925620640; Tue, 21 Oct 2014 14:07:00 -0700 (PDT) Received: by 10.202.197.13 with HTTP; Tue, 21 Oct 2014 14:07:00 -0700 (PDT) In-Reply-To: References: <201410211115.s9LBFkro030607@d06av02.portsmouth.uk.ibm.com> Date: Tue, 21 Oct 2014 21:07:00 -0000 Message-ID: Subject: Re: [PATCH 0/2] Make chained function calls in expressions work From: Siva Chandra To: Ulrich Weigand Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00554.txt.bz2 On Tue, Oct 21, 2014 at 1:30 PM, Siva Chandra wrote: > On Tue, Oct 21, 2014 at 4:15 AM, Ulrich Weigand wrote: >> I was not refering to the ABI, but the C++ standard semantics that >> define what happen when you pass an *object* as argument to a function >> that expects a *reference* parameter. See e.g.: >> http://en.cppreference.com/w/cpp/language/reference_initialization >> >> References are initialized in the following situations: >> [...] >> 3) In a function call expression, when the function parameter >> has reference type >> [...] >> The effects of reference initialization are: >> [...] >> if the reference is [...] lvalue reference to const: >> [...] >> a temporary of type T is constructed and copy-initialized from >> object. The reference is then bound to this temporary > > I do not think applies in general for const references. IIUC, it > applies to prvalues/literals [section 12.2 in the C++ std]. For all > other kind of values, the two cases above this point should be > applied. I should have said prvalues of non-class type. > Function arguments could be xvalues. IIUC, temporaries are created > only for prvalues. You can point me to the appropriate section in the > C++ standard if I am wrong. Same here.