-5ea5c078829ae83bccb598772fff7c1a04e23e65
+4c88f31a83ca28963d29d6dc9fcdb2e9b093610c
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
std::set<std::string> uniq_idents;
uniq_idents.insert(name);
+ std::string dup_name;
+ Location dup_loc;
// We've seen one identifier. If we see a comma now, this could be
// "a, *p = 1, 2".
id = this->gogo_->pack_hidden_name(id, is_id_exported);
ins = uniq_idents.insert(id);
if (!ins.second && !Gogo::is_sink_name(id))
- error_at(id_location, "multiple assignments to %s",
- Gogo::message_name(id).c_str());
+ {
+ dup_name = Gogo::message_name(id);
+ dup_loc = id_location;
+ }
til.push_back(Typed_identifier(id, NULL, location));
}
go_assert(this->peek_token()->is_op(OPERATOR_COLONEQ));
const Token* token = this->advance_token();
+ if (!dup_name.empty())
+ error_at(dup_loc, "multiple assignments to %s", dup_name.c_str());
+
if (p_range_clause != NULL && token->is_keyword(KEYWORD_RANGE))
{
this->range_clause_decl(&til, p_range_clause);