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
a8f3a62d
Commit
a8f3a62d
authored
Dec 21, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't permit assigning abstract string/bool to numeric variable.
From-SVN: r168145
parent
67eff3d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
gcc/go/gofrontend/types.cc
+6
-4
No files found.
gcc/go/gofrontend/types.cc
View file @
a8f3a62d
...
@@ -543,15 +543,17 @@ Type::are_assignable(const Type* lhs, const Type* rhs, std::string* reason)
...
@@ -543,15 +543,17 @@ Type::are_assignable(const Type* lhs, const Type* rhs, std::string* reason)
||
lhs
->
interface_type
()
!=
NULL
))
||
lhs
->
interface_type
()
!=
NULL
))
return
true
;
return
true
;
// An untyped constant may be assigned to a numeric type if it is
// An untyped numeric constant may be assigned to a numeric type if
// representable in that type.
// it is representable in that type.
if
(
rhs
->
is_abstract
()
if
((
rhs
->
is_abstract
()
&&
(
rhs
->
integer_type
()
!=
NULL
||
rhs
->
float_type
()
!=
NULL
||
rhs
->
complex_type
()
!=
NULL
))
&&
(
lhs
->
integer_type
()
!=
NULL
&&
(
lhs
->
integer_type
()
!=
NULL
||
lhs
->
float_type
()
!=
NULL
||
lhs
->
float_type
()
!=
NULL
||
lhs
->
complex_type
()
!=
NULL
))
||
lhs
->
complex_type
()
!=
NULL
))
return
true
;
return
true
;
// Give some better error messages.
// Give some better error messages.
if
(
reason
!=
NULL
&&
reason
->
empty
())
if
(
reason
!=
NULL
&&
reason
->
empty
())
{
{
...
...
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