From: Jason Merrill Date: Sat, 29 Mar 2003 00:50:46 +0000 (-0500) Subject: re PR c++/10245 (?: operator requires public copy constructor of return type) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff77a44171a828654464107a574edfd2e05040d3;p=gcc.git re PR c++/10245 (?: operator requires public copy constructor of return type) PR c++/10245 * cvt.c (force_rvalue): New fn. * call.c (build_conditional_expr): Use it. * cp-tree.h: Declare it. [[Split portion of a mixed commit.]] From-SVN: r65006.2 --- diff --git a/gcc/testsuite/g++.dg/conversion/cond2.C b/gcc/testsuite/g++.dg/conversion/cond2.C new file mode 100644 index 00000000000..d31de33e275 --- /dev/null +++ b/gcc/testsuite/g++.dg/conversion/cond2.C @@ -0,0 +1,15 @@ +// PR c++/10245 + +struct X {}; + +struct Y { + Y (); + operator X () const; +private: + Y (const Y &); +}; + +Y y; +void foo() { + X x = (1 ? Y() : Y()); +}