Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Siva Chandra <sivachandra@google.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 0/2] Make chained function calls in expressions work
Date: Tue, 21 Oct 2014 21:07:00 -0000	[thread overview]
Message-ID: <CAGyQ6gyCu78r89-yGROi+Gvqyi6pQCAje5hG6eLbxrJaBbU=Bw@mail.gmail.com> (raw)
In-Reply-To: <CAGyQ6gzHfLATvfUZVWzxvM+D_b=JQ2VAUoRpyAAxq6TDrYnA3Q@mail.gmail.com>

On Tue, Oct 21, 2014 at 1:30 PM, Siva Chandra <sivachandra@google.com> wrote:
> On Tue, Oct 21, 2014 at 4:15 AM, Ulrich Weigand <uweigand@de.ibm.com> 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.


  reply	other threads:[~2014-10-21 21:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 13:29 Siva Chandra
2014-10-01  0:42 ` Siva Chandra
2014-10-01 13:15   ` Ulrich Weigand
2014-10-01 18:05     ` Siva Chandra
2014-10-01 18:26       ` Siva Chandra
2014-10-20 16:01         ` Ulrich Weigand
2014-10-20 19:56           ` Siva Chandra
2014-10-21 11:15             ` Ulrich Weigand
2014-10-21 20:30               ` Siva Chandra
2014-10-21 21:07                 ` Siva Chandra [this message]
2014-10-22 17:00                 ` Ulrich Weigand
2014-10-23 15:07                   ` Siva Chandra
2014-10-23 16:09                     ` Ulrich Weigand
2014-10-23 23:31                       ` Siva Chandra
2014-10-09  0:02   ` Siva Chandra
2014-10-15 13:43     ` Siva Chandra

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='CAGyQ6gyCu78r89-yGROi+Gvqyi6pQCAje5hG6eLbxrJaBbU=Bw@mail.gmail.com' \
    --to=sivachandra@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /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: link
Be 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