public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Ansgar Esztermann <ansgar@thphy.uni-duesseldorf.de>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/9440: [3.4 regression] error message about non-lvalue
Date: Tue, 25 Feb 2003 12:36:00 -0000	[thread overview]
Message-ID: <20030225123600.21498.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/9440; it has been noted by GNATS.

From: Ansgar Esztermann <ansgar@thphy.uni-duesseldorf.de>
To: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>, <nobody@gcc.gnu.org>,
        <gcc-prs@gcc.gnu.org>, <andrew@andypo.net>
Cc:  
Subject: Re: c++/9440: [3.4 regression] error message about non-lvalue
Date: Tue, 25 Feb 2003 13:33:00 +0100 (CET)

 As far as I can see, this is what happens:
 
 The compiler creates temporaries for args 2 and 3 of the conditional
 operator (i.e. A() and a in Andrew's example) by calling A(const A&).
 The parameter to the copy constructor is calculated by build_this()
 in cp/call.c. This function, however, only knows one way to calculate
 the this pointer: it uses ADDR_EXPR, which does not work for non-
 lvalues - hence the error message concerning "unary &".
 This problem did not occur prior to the patch cited by Craig, because
 the compiler would simply neglect to build temporaries for non-lvalues
 occurring as arguments to the conditional operator.
 
 I think the best way to fix PR 9440 (and probably 9537) is to fix
 build_this(), i.e. crawl along the tree (at least for non-lvalues)
 to find /this/ rather than blindly use ADDR_EXPR.
 
 I can try to implement this, but my knowledge about the internals
 of cc1plus is rather scarce, so if you a quick solution is needed,
 someone else might want to step forward.
 
 Ansgar
 
 -- 
 Institut fuer theoretische Physik II    | Geb. 25.32.02
 Heinrich-Heine-Universitaet Duesseldorf | +49-211-8112059 (phone)
 Universitaetsstr. 1                     | +49-211-8112262 (fax)
 D-40225 Duesseldorf, Germany            | 
 


                 reply	other threads:[~2003-02-25 12:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030225123600.21498.qmail@sources.redhat.com \
    --to=ansgar@thphy.uni-duesseldorf.de \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).