Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
8b06e188
Commit
8b06e188
authored
Nov 04, 2014
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Logical operators should yield untyped bool for untyped operands.
Fixes issue 6671 for gccgo. From-SVN: r217094
parent
4456c6bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
gcc/go/gofrontend/expressions.cc
+0
-9
gcc/testsuite/go.test/test/fixedbugs/issue3924.go
+3
-3
No files found.
gcc/go/gofrontend/expressions.cc
View file @
8b06e188
...
...
@@ -5314,15 +5314,6 @@ 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
)
{
...
...
gcc/testsuite/go.test/test/fixedbugs/issue3924.go
View file @
8b06e188
//
errorcheck
//
compile
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
...
...
@@ -9,5 +9,5 @@ package foo
type
mybool
bool
var
x
,
y
=
1
,
2
var
_
mybool
=
x
<
y
&&
x
<
y
// ERROR "cannot use"
var
_
mybool
=
x
<
y
||
x
<
y
// ERROR "cannot use"
var
_
mybool
=
x
<
y
&&
x
<
y
var
_
mybool
=
x
<
y
||
x
<
y
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment