From 22f005372107b9c6023fd30efc47e2c616727de2 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 17 Feb 2009 11:01:02 +0100 Subject: Fixed bug 3734 and added comment for bug 3619 --- cpp/src/slice2cpp/Gen.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cpp/src/slice2cpp/Gen.cpp') 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()) { -- cgit v1.2.3