projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
156dbd1
)
compiler: Don't inherit logical operator operand type from context.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 10 Oct 2013 03:28:22 +0000
(
03:28
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 10 Oct 2013 03:28:22 +0000
(
03:28
+0000)
From-SVN: r203337
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index e96ab7606c2e3f651c493fecfccc24edd951604e..8b53331d073026ac67cd3187ba53635306d38634 100644
(file)
--- a/
gcc/go/gofrontend/expressions.cc
+++ b/
gcc/go/gofrontend/expressions.cc
@@
-5606,6
+5606,15
@@
Binary_expression::do_determine_type(const Type_context* context)
subcontext.type = NULL;
}
+ if (this->op_ == OPERATOR_ANDAND || this->op_ == OPERATOR_OROR)
+ {
+ // For a logical operation, the context does not determine the
+ // types of the operands. The operands must be some boolean
+ // type but if the context has a boolean type they do not
+ // inherit it. See http://golang.org/issue/3924.
+ subcontext.type = NULL;
+ }
+
// Set the context for the left hand operand.
if (is_shift_op)
{