diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-06 10:37:02 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-06 10:37:02 +0000 |
commit | a7d4dc67834c1b62ec4008776151b0f8b3724467 (patch) | |
tree | e01fb2e7447c61db75f8096bc82cb4f7c48a43d8 /gcc/c-typeck.c | |
parent | 25b577c6b5e2a103103be966516ff8935c854345 (diff) | |
download | gcc-a7d4dc67834c1b62ec4008776151b0f8b3724467.tar.gz |
PR c/47150
* c-convert.c (convert): When converting a complex expression
other than COMPLEX_EXPR to a different complex type, ensure
c_save_expr is called instead of save_expr, unless in_late_binary_op.
* c-typeck.c (convert_for_assignment): Set in_late_binary_op also
when converting COMPLEX_TYPE.
* gcc.c-torture/compile/pr47150.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168537 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 149235a8e77..689423ea028 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5274,10 +5274,10 @@ convert_for_assignment (location_t location, tree type, tree rhs, { tree ret; bool save = in_late_binary_op; - if (codel == BOOLEAN_TYPE) + if (codel == BOOLEAN_TYPE || codel == COMPLEX_TYPE) in_late_binary_op = true; ret = convert_and_check (type, orig_rhs); - if (codel == BOOLEAN_TYPE) + if (codel == BOOLEAN_TYPE || codel == COMPLEX_TYPE) in_late_binary_op = save; return ret; } |