diff mbox

Go patch committed: Better error for invalid use of builtin

Message ID mcr8vkxzit5.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 24, 2012, 7 a.m. UTC
This patch to the Go compiler improves the error message for the invalid
use of a special builtin function like unsafe.Sizeof.  Bootstrapped and
ran Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r c1acc6a7e12a go/expressions.cc
--- a/go/expressions.cc	Mon Jan 23 15:53:43 2012 -0800
+++ b/go/expressions.cc	Mon Jan 23 22:58:26 2012 -0800
@@ -1328,7 +1328,8 @@ 
   // can't take their address.
   if (fntype->is_builtin())
     {
-      error_at(this->location(), "invalid use of special builtin function %qs",
+      error_at(this->location(),
+	       "invalid use of special builtin function %qs; must be called",
 	       this->function_->name().c_str());
       return error_mark_node;
     }