From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32660 invoked by alias); 4 Nov 2014 15:08:09 -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 32643 invoked by uid 89); 4 Nov 2014 15:08:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 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-f47.google.com Received: from mail-oi0-f47.google.com (HELO mail-oi0-f47.google.com) (209.85.218.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 04 Nov 2014 15:08:08 +0000 Received: by mail-oi0-f47.google.com with SMTP id a3so9897921oib.34 for ; Tue, 04 Nov 2014 07:08:06 -0800 (PST) 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=WtAwq0ykDs0WSmIeqpvzvYYQdegG5Z+pPmFozN9hFEA=; b=e6Hr+tRfS+NTHC1f23IqFms8s39gtvUB+IEZ1HVsQ7A30+Dnb7BMTyggeFxxP60XQd OI3upOWG4uzlBccK5vsoRbcoarYtlQDXSGa+k2z6OCOXN3jlNXsbr1fnm9zEeyfItvst MnsMuqr5HTPPDWXb5ImvCWJiVT8Clwlw+X7davBjrDJD3GoX36KZUfhzD6LWKCGOHeyW gQD4/1MWVSRugsMZ5Z+4jgq5ZwRaFRR9MfLKzycSBhhea9yvcyLucEsRnMBRtzMGKgXg nK/llbOn1qmPXeT8FG9ud0RznEycYi1RTzfDAiP+gzpUVPr8H6+wFoKGuL+X1qdn8PwZ 3zyQ== X-Gm-Message-State: ALoCoQmL8FRRsQ3E+B14VQr0xmiN8EJcQUGtBe3IvRz5F7fOm3jaKK/0I0KZJxHliqo08xbvtCuy MIME-Version: 1.0 X-Received: by 10.182.20.15 with SMTP id j15mr2758135obe.52.1415113685984; Tue, 04 Nov 2014 07:08:05 -0800 (PST) Received: by 10.202.197.13 with HTTP; Tue, 4 Nov 2014 07:08:05 -0800 (PST) In-Reply-To: <201411041343.sA4DhRje024520@d06av02.portsmouth.uk.ibm.com> References: <201411041343.sA4DhRje024520@d06av02.portsmouth.uk.ibm.com> Date: Tue, 04 Nov 2014 15:08:00 -0000 Message-ID: Subject: Re: [PATCH v4] 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-11/txt/msg00064.txt.bz2 On Tue, Nov 4, 2014 at 5:43 AM, Ulrich Weigand wrote: > Well, that's true. For simple structs, we would have to create a > temporary at the point of call when using a reference; we discussed > adding this anyway (it's necessary for scalars as well) ... I agree for scalars, but is it worth the effort to make this check for structs/unions? Consider this example: struct Simpler { char c; char getc (); }; struct Simple { Simpler a, b; }; Simple make_simple () { Simple s; s.a.c = 'a'; s.b.c = 'b'; return s; } Simple does not have any methods, but Simpler has. The ABI returns objects of Simple type in register. However, one could have an expression like this: make_simple().a.geta() which is equivalent to f().g().