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
This commit is contained in:
Jason Merrill 2003-03-28 19:50:46 -05:00
parent f7b9026e22
commit ff77a44171

View File

@ -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());
}