aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/ast-dump.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-09-20 17:52:23 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-09-20 17:52:23 +0000
commit3c1917945db0b725842fd39e76c39e7de049afa4 (patch)
tree24ad686007250c0780f1f0e3ce5bb3da1c01c8cb /gcc/go/gofrontend/ast-dump.cc
parent9b1ba33cf61cc1ca76bacd1eb3a41fe0eb5d12e9 (diff)
downloadgcc-3c1917945db0b725842fd39e76c39e7de049afa4.zip
gcc-3c1917945db0b725842fd39e76c39e7de049afa4.tar.gz
gcc-3c1917945db0b725842fd39e76c39e7de049afa4.tar.bz2
re PR go/77625 (go/gofrontend/ast-dump.cc:169:42: error: ‘new’ of type ‘std::ofstr eam {aka std::basic_ofstream<char>}’ with extended alignment 16)
PR go/77625 compiler: allocate std::ofstream as a local variable GCC PR 77625 points out a warning about new std::ofstream. I don't know how that is supposed to work, but in this case the std::ofstream may as well be a local variable anyhow. Reviewed-on: https://go-review.googlesource.com/29435 From-SVN: r240279
Diffstat (limited to 'gcc/go/gofrontend/ast-dump.cc')
-rw-r--r--gcc/go/gofrontend/ast-dump.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/ast-dump.cc b/gcc/go/gofrontend/ast-dump.cc
index 72b0142..8dad18c 100644
--- a/gcc/go/gofrontend/ast-dump.cc
+++ b/gcc/go/gofrontend/ast-dump.cc
@@ -166,24 +166,24 @@ const char* kAstDumpFileExtension = ".dump.ast";
void
Ast_dump_context::dump(Gogo* gogo, const char* basename)
{
- std::ofstream* out = new std::ofstream();
+ std::ofstream out;
std::string dumpname(basename);
dumpname += ".dump.ast";
- out->open(dumpname.c_str());
+ out.open(dumpname.c_str());
- if (out->fail())
+ if (out.fail())
{
error("cannot open %s:%m, -fgo-dump-ast ignored", dumpname.c_str());
return;
}
this->gogo_ = gogo;
- this->ostream_ = out;
+ this->ostream_ = &out;
Ast_dump_traverse_blocks_and_functions adtbf(this);
gogo->traverse(&adtbf);
- out->close();
+ out.close();
}
// Dump a textual representation of a type to the