diff options
Diffstat (limited to 'gcc/go/gofrontend/parse.cc')
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index b1925ed..a4740cf 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -1442,6 +1442,7 @@ Parse::const_decl() void Parse::const_spec(int iota, Type** last_type, Expression_list** last_expr_list) { + Location loc = this->location(); Typed_identifier_list til; this->identifier_list(&til); @@ -1466,7 +1467,11 @@ Parse::const_spec(int iota, Type** last_type, Expression_list** last_expr_list) for (Expression_list::const_iterator p = (*last_expr_list)->begin(); p != (*last_expr_list)->end(); ++p) - expr_list->push_back((*p)->copy()); + { + Expression* copy = (*p)->copy(); + copy->set_location(loc); + expr_list->push_back(copy); + } } else { |