summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Scharnowski <scharnowski@posteo.net>2022-03-10 23:29:52 +0100
committerJens Geyer <Jens-G@users.noreply.github.com>2022-03-12 00:02:38 +0100
commit8ef4ed1b2a0b28f27d35516cfb56a16c2583de0c (patch)
treed118beb0773083881f694cb44022d1278c240bdb
parent649dcfd4a06dbe529870015e7f838d5f46426648 (diff)
downloadthrift-8ef4ed1b2a0b28f27d35516cfb56a16c2583de0c.tar.gz
workaround MSVC compiler bug
Client: cpp
-rw-r--r--compiler/cpp/src/thrift/generate/t_generator.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_generator.h b/compiler/cpp/src/thrift/generate/t_generator.h
index f82463d0c..21c2798e5 100644
--- a/compiler/cpp/src/thrift/generate/t_generator.h
+++ b/compiler/cpp/src/thrift/generate/t_generator.h
@@ -419,7 +419,9 @@ public:
old_file.open(output_file_path.c_str(), std::ios::in);
if (old_file) {
- std::string const old_file_contents(static_cast<std::ostringstream const&>(std::ostringstream() << old_file.rdbuf()).str());
+ std::ostringstream oss;
+ oss << old_file.rdbuf();
+ std::string const old_file_contents(oss.str());
old_file.close();
if (old_file_contents != str()) {