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 -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;
}