Commit 77b996cc by Jason Merrill Committed by Jason Merrill

re PR c++/9342 (another ICE in cp_expr_size at cp/cp-lang.c: 304)

        PR c++/9342
        * call.c (build_conditional_expr): Always do lvalue-rvalue
        conversion.

From-SVN: r61457
parent 5dae1114
2003-01-17 Jason Merrill <jason@redhat.com>
PR c++/9342
* call.c (build_conditional_expr): Always do lvalue-rvalue
conversion.
2003-01-17 Mark Mitchell <mark@codesourcery.com> 2003-01-17 Mark Mitchell <mark@codesourcery.com>
PR c++/9294 PR c++/9294
......
...@@ -3187,14 +3187,14 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) ...@@ -3187,14 +3187,14 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
We use ocp_convert rather than build_user_type_conversion because the We use ocp_convert rather than build_user_type_conversion because the
latter returns NULL_TREE on failure, while the former gives an error. */ latter returns NULL_TREE on failure, while the former gives an error. */
if (IS_AGGR_TYPE (TREE_TYPE (arg2)) && real_lvalue_p (arg2)) if (IS_AGGR_TYPE (TREE_TYPE (arg2)))
arg2 = ocp_convert (TREE_TYPE (arg2), arg2, arg2 = ocp_convert (TREE_TYPE (arg2), arg2,
CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL); CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL);
else else
arg2 = decay_conversion (arg2); arg2 = decay_conversion (arg2);
arg2_type = TREE_TYPE (arg2); arg2_type = TREE_TYPE (arg2);
if (IS_AGGR_TYPE (TREE_TYPE (arg3)) && real_lvalue_p (arg3)) if (IS_AGGR_TYPE (TREE_TYPE (arg3)))
arg3 = ocp_convert (TREE_TYPE (arg3), arg3, arg3 = ocp_convert (TREE_TYPE (arg3), arg3,
CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL); CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL);
else else
......
// PR c++/9342
// We were failing to wrap def().user in a TARGET_EXPR, so copying it
// into the reference temp used a bitwise copy.
struct QString
{
QString( const QString & );
QString &operator=( const QString & );
};
struct ServerSettings
{
QString user;
};
extern ServerSettings def();
extern void arg( const QString& a );
void startSession( bool b, QString s )
{
arg (b ? def().user : s);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment