From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7075 invoked by alias); 28 Jan 2003 18:26:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7058 invoked by uid 71); 28 Jan 2003 18:26:01 -0000 Date: Tue, 28 Jan 2003 18:26:00 -0000 Message-ID: <20030128182601.7057.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Andrew Pollard Subject: Re: c++/9440: [3.4 regression] error message about "non-lvalue in unary '&'" when using ?: operator Reply-To: Andrew Pollard X-SW-Source: 2003-01/txt/msg01623.txt.bz2 List-Id: The following reply was made to PR c++/9440; it has been noted by GNATS. From: Andrew Pollard To: bangerth@dealii.org, andrew@andypo.net, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/9440: [3.4 regression] error message about "non-lvalue in unary '&'" when using ?: operator Date: Tue, 28 Jan 2003 18:16:44 GMT bangerth@dealii.org replied: > Confirmed. The problem is the lack of a copy constructor, > but the message is profoundly unhelpful in detecting this. I don't think a copy constructor should have anything to do with it. Doesn't the compiler synthesize a copy constructor if there isn't one defined? Anyway, even if I add one, I still get the error... odd.cxx: -------------- struct A { explicit A(int = 0); A(const A&); operator int() const; }; A bar(bool b, const A& a) { return (b ? A() : a); } -------------- % g++34 -c odd.cxx odd.cxx: In function `A bar(bool, const A&)': odd.cxx:10: error: non-lvalue in unary `&' Andrew.