summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-02-17 11:01:02 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-02-17 11:01:02 +0100
commit22f005372107b9c6023fd30efc47e2c616727de2 (patch)
tree109ed3065d6f1cb3e150f109d1c4ba39ed0737b8 /cpp/src/slice2cpp/Gen.cpp
parentBug 3668 - C# translator generates bogus code for metadata. (diff)
downloadice-22f005372107b9c6023fd30efc47e2c616727de2.tar.bz2
ice-22f005372107b9c6023fd30efc47e2c616727de2.tar.xz
ice-22f005372107b9c6023fd30efc47e2c616727de2.zip
Fixed bug 3734 and added comment for bug 3619
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 513b9f684ee..38576ced309 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -2715,6 +2715,11 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p)
}
C << nl << "bool __ok = __og.invoke();";
+
+ //
+ // Declare the return __ret variable at the top-level scope to
+ // enable NRVO with GCC (see also bug #3619).
+ //
writeAllocateCode(C, ParamDeclList(), ret, p->getMetaData(), _useWstring);
if(!p->returnsData())
{