summaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-10 03:28:22 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-10 03:28:22 +0000
commit02ffd97fe94b59b1fbf531f80476c1c53b6fcea3 (patch)
tree732ffbd7efa943c8760280cb9cf326fb5375e502 /gcc/go
parentc66c3018d6239b9b289103b3cb7d59952814c30c (diff)
downloadgcc-02ffd97fe94b59b1fbf531f80476c1c53b6fcea3.tar.gz
compiler: Don't inherit logical operator operand type from context.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203337 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/expressions.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index e96ab7606c2..8b53331d073 100644
--- 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)
{