From: Ian Lance Taylor Date: Mon, 5 Nov 2018 20:59:38 +0000 (+0000) Subject: compiler: handle abstract type in builtin numeric const value X-Git-Tag: releases/gcc-7.4.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62aec8fdd62378937c38039dc6970d81a6d29fc7;p=thirdparty%2Fgcc.git 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: r265818 --- diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index fee3203714f4..1f43c4af16f7 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -8065,7 +8065,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;