summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-15 23:12:03 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-15 23:12:03 +0000
commita0d8874eac2d7029f389f79af35f0df2e10fed5d (patch)
treef7c33e6474f324106342885a4cadf4647f3fdc54
parent242418a3cc155e06411da3b5e7aff50622d12ad4 (diff)
downloadgcc-a0d8874eac2d7029f389f79af35f0df2e10fed5d.tar.gz
compiler: Report init dependency errors with builtin functions.
Fixes golang/go#12319. Reviewed-on: https://go-review.googlesource.com/13931 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227813 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc12
2 files changed, 8 insertions, 6 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 21458cde569..bcaabac4b9c 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-eac8b31fec761c8da0606a70ae0547ff0b12e8db
+01a574c1b2bb244be764b6a18aab980ca0aef43c
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 488c76ca6bc..1c329b83050 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -6885,11 +6885,6 @@ Builtin_call_expression::do_flatten(Gogo*, Named_object*,
Statement_inserter* inserter)
{
Location loc = this->location();
- if (this->is_erroneous_call())
- {
- go_assert(saw_errors());
- return Expression::make_error(loc);
- }
switch (this->code_)
{
@@ -8064,6 +8059,13 @@ Builtin_call_expression::do_get_backend(Translate_context* context)
{
Gogo* gogo = context->gogo();
Location location = this->location();
+
+ if (this->is_erroneous_call())
+ {
+ go_assert(saw_errors());
+ return gogo->backend()->error_expression();
+ }
+
switch (this->code_)
{
case BUILTIN_INVALID: