mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-24 19:29:47 +08:00
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:
parent
f7b9026e22
commit
ff77a44171
15
gcc/testsuite/g++.dg/conversion/cond2.C
Normal file
15
gcc/testsuite/g++.dg/conversion/cond2.C
Normal 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());
|
||||
}
|
Loading…
Reference in New Issue
Block a user