From: Jason Merrill Date: Fri, 21 Mar 2003 07:13:53 +0000 (-0500) Subject: re PR c++/9440 (error message about "non-lvalue in unary '&'" when using ?: operator) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2196cf1346260dfefd9a2a55233cc55d00240947;p=gcc.git re PR c++/9440 (error message about "non-lvalue in unary '&'" when using ?: operator) PR c++/9440 * call.c (build_conditional_expr): Use convert rather than an explicit NOP_EXPR. From-SVN: r64651 --- diff --git a/gcc/testsuite/g++.dg/conversion/cond1.C b/gcc/testsuite/g++.dg/conversion/cond1.C new file mode 100644 index 00000000000..16184ccb411 --- /dev/null +++ b/gcc/testsuite/g++.dg/conversion/cond1.C @@ -0,0 +1,12 @@ +// PR c++/9440 + struct A { + explicit A(int = 0); + A(const A&); + operator int() const; + }; + + A + bar(bool b, const A& a) + { + return (b ? A() : a); + }