Patchwork [gccgo] Mention function name in cmplx type error

login
register
mail settings
Submitter Ian Taylor
Date Aug. 31, 2010, 6:29 p.m.
Message ID <mcrsk1ueiuh.fsf@google.com>
Download mbox | patch
Permalink /patch/63311/
State New
Headers show

Comments

Ian Taylor - Aug. 31, 2010, 6:29 p.m.
This small patch changes gccgo to mention the function name when
reporting a type error in the use of the predeclared function cmplx.
Committed to gccgo branch.

Ian

Patch

diff -r 79786d3fc04a go/expressions.cc
--- a/go/expressions.cc	Tue Aug 31 11:08:59 2010 -0700
+++ b/go/expressions.cc	Tue Aug 31 11:27:25 2010 -0700
@@ -7083,9 +7083,10 @@ 
 	  this->set_is_error();
 	else if (!Type::are_identical(args->front()->type(),
 				      args->back()->type(), NULL))
-	  this->report_error(_("arguments must have identical types"));
+	  this->report_error(_("cmplx arguments must have identical types"));
 	else if (args->front()->type()->float_type() == NULL)
-	  this->report_error(_("arguments must have floating-point type"));
+	  this->report_error(_("cmplx arguments must have "
+			       "floating-point type"));
       }
       break;