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
This commit is contained in:
parent
c77e059777
commit
2196cf1346
1 changed files with 12 additions and 0 deletions
12
gcc/testsuite/g++.dg/conversion/cond1.C
Normal file
12
gcc/testsuite/g++.dg/conversion/cond1.C
Normal file
|
@ -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);
|
||||
}
|
Loading…
Add table
Reference in a new issue