summaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-20 20:44:23 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-20 20:44:23 +0000
commit80c055850b13723a44bd87772f8a3bdf7df15fbd (patch)
tree7686f63e206673ae55eb2c533d60d9f6d2f58f00 /gcc/go
parent6b5e0fac67dd1bdbdc86f2b70a350ea5cd841cf0 (diff)
downloadgcc-80c055850b13723a44bd87772f8a3bdf7df15fbd.tar.gz
compiler: Report errors after evaluating invalid constant.
The fix for golang/go#11541 made the assertion that getting an invalid Numeric_constant after evaluating an invalid constant must result in an error in a binary expression. However, a Numeric_constant can be invalid if it is unset, which occurs when either operand cannot be converted to the right type. These errors are issued after the Numeric_constant is lowered. Fixes golang/go#12615. Reviewed-on: https://go-review.googlesource.com/14646 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc7
2 files changed, 1 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index d184a431a55..6fcd18593a6 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-302d8abbc499e28088d758ae8b2c024d8e50b9b3
+11e249a59e8c627fe9c2938c38e39cb1efefb1fb
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 20ca10b0524..0d25dda1f44 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -4909,14 +4909,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*,
Numeric_constant nc;
if (!Binary_expression::eval_constant(op, &left_nc, &right_nc,
location, &nc))
- {
- if (nc.is_invalid())
- {
- go_assert(saw_errors());
- return Expression::make_error(location);
- }
return this;
- }
return nc.expression(location);
}
}