compiler: Report errors for malformed builtin calls.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 31 Jul 2015 23:17:49 +0000 (23:17 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 31 Jul 2015 23:17:49 +0000 (23:17 +0000)
    Errors reported from malformed builtin calls are handled in a later
    pass than the one in which they are detected.  If a malformed builtin
    call is lowered into an error expression too early, these errors will
    never be reported.

    Fixes golang/go#11561.

    Reviewed-on: https://go-review.googlesource.com/12778

From-SVN: r226459

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc

index 732b33d36a08c8407d968887bdac242185bc056a..4ebc803a9152778c1c23bfca1880cefd521d761f 100644 (file)
@@ -1,4 +1,4 @@
-bc4dda16f8686ab6e7335adfdfd2c6cc81cb2eb5
+2bf7c643a1d2f8503070c8e6cb87852026e32400
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 065be33a9671f6d52cc2232f1dcfd792b208ba3a..976e34b3688b409fbaa95ff15fb10470dd2c3c28 100644 (file)
@@ -8499,7 +8499,8 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function,
     {
       if (!this->fn_->type()->is_error())
        this->report_error(_("expected function"));
-      return Expression::make_error(loc);
+      this->set_is_error();
+      return this;
     }
 
   // Handle an argument which is a call to a function which returns