re PR c++/9440 (error message about "non-lvalue in unary '&'" when using ?: operator)
authorJason Merrill <jason@gcc.gnu.org>
Fri, 21 Mar 2003 07:13:53 +0000 (02:13 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 21 Mar 2003 07:13:53 +0000 (02:13 -0500)
        PR c++/9440
        * call.c (build_conditional_expr): Use convert rather than an
        explicit NOP_EXPR.

From-SVN: r64651

gcc/testsuite/g++.dg/conversion/cond1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/conversion/cond1.C b/gcc/testsuite/g++.dg/conversion/cond1.C
new file mode 100644 (file)
index 0000000..16184cc
--- /dev/null
@@ -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);
+ }