diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-09-25 03:28:06 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-09-25 03:28:06 +0000 |
commit | 28d18db363050e2e8122d202cd59d131a3ffa167 (patch) | |
tree | 6cadfca1790ee7591d7dc8676991f00011e27f1f /gcc/go/gofrontend/parse.cc | |
parent | 6a9502fdf909ec3fbda5f42b6963f726c8cab4ed (diff) | |
download | gcc-28d18db363050e2e8122d202cd59d131a3ffa167.zip gcc-28d18db363050e2e8122d202cd59d131a3ffa167.tar.gz gcc-28d18db363050e2e8122d202cd59d131a3ffa167.tar.bz2 |
compiler: don't permit nil assignment to blank identifier.
Fixes https://code.google.com/p/go/issues/detail?id=6005.
From-SVN: r202881
Diffstat (limited to 'gcc/go/gofrontend/parse.cc')
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 9d11285..befe4bc 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -1940,12 +1940,9 @@ Parse::init_var(const Typed_identifier& tid, Type* type, Expression* init, { if (this->gogo_->in_global_scope()) return this->create_dummy_global(type, init, location); - else if (type == NULL) - this->gogo_->add_statement(Statement::make_statement(init, true)); else { - // With both a type and an initializer, create a dummy - // variable so that we will check whether the + // Create a dummy variable so that we will check whether the // initializer can be assigned to the type. Variable* var = new Variable(type, init, false, false, false, location); |