diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2003-03-21 02:13:53 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-03-21 02:13:53 -0500 |
commit | 2196cf1346260dfefd9a2a55233cc55d00240947 (patch) | |
tree | 92734c5bcda5626a729c8d91f476db5e56921185 /gcc | |
parent | c77e05977761f777de04518f07184fd70d91d254 (diff) | |
download | gcc-2196cf1346260dfefd9a2a55233cc55d00240947.zip gcc-2196cf1346260dfefd9a2a55233cc55d00240947.tar.gz gcc-2196cf1346260dfefd9a2a55233cc55d00240947.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/conversion/cond1.C | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/conversion/cond1.C b/gcc/testsuite/g++.dg/conversion/cond1.C new file mode 100644 index 0000000..16184cc --- /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); + } |