diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-11-05 21:02:07 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-11-05 21:02:07 +0000 |
commit | 7bbdffa22bd3e0d3fcedb13447b33dd9bfef6f7f (patch) | |
tree | 5941083665267aecf53dff5ede0a4a3d90696c09 | |
parent | b40a67df7c5342204843f40f16ded89968bddd06 (diff) | |
download | gcc-7bbdffa22bd3e0d3fcedb13447b33dd9bfef6f7f.zip gcc-7bbdffa22bd3e0d3fcedb13447b33dd9bfef6f7f.tar.gz gcc-7bbdffa22bd3e0d3fcedb13447b33dd9bfef6f7f.tar.bz2 |
compiler: handle abstract type in builtin numeric const value
Builtin_call_expression::do_numeric_constant_value can be called by
Array_type::verify_length before the determine types pass, so accept
an abstract type.
Test case is https://golang.org/cl/147537.
Fixes golang/go#28601
Reviewed-on: https://go-review.googlesource.com/c/147442
From-SVN: r265820
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index e455647..1cdb8a9 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -df841cce9fd271a25269e3514c2e9b61deaf2c4c +5fcfe352ad91945a4f4d0dcfb6309df9bd072c7d 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 e1feb66..75fa19b 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -8294,7 +8294,7 @@ Builtin_call_expression::do_numeric_constant_value(Numeric_constant* nc) const if (arg_type->is_error()) return false; if (arg_type->is_abstract()) - return false; + arg_type = arg_type->make_non_abstract_type(); if (this->seen_) return false; |