From patchwork Thu Sep 2 00:41:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [gccgo] Change location of cast Date: Wed, 01 Sep 2010 14:41:54 -0000 From: Ian Taylor X-Patchwork-Id: 63430 Message-Id: To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com This small gccgo patch changes the location of a cast T(v) from the start of the type to the left parenthesis. This is mainly for convenience of the testsuite, and should be just as good if not better for humans. Ian diff -r 21b3034688ff go/parse.cc --- a/go/parse.cc Wed Sep 01 17:38:32 2010 -0700 +++ b/go/parse.cc Wed Sep 01 17:39:58 2010 -0700 @@ -2503,6 +2503,7 @@ ret = this->composite_lit(ret->type(), ret->location()); else if (this->peek_token()->is_op(OPERATOR_LPAREN)) { + source_location loc = this->location(); this->advance_token(); Expression* expr = this->expression(PRECEDENCE_NORMAL, false, true, NULL); @@ -2512,7 +2513,7 @@ this->advance_token(); if (expr->is_error_expression()) return expr; - ret = Expression::make_cast(ret->type(), expr, ret->location()); + ret = Expression::make_cast(ret->type(), expr, loc); } }