diff options
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index fdabfd205e0..29b353e8e19 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1383,7 +1383,24 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) } H << allParamDecls << epar << ';'; } + + H.zeroIndent(); + H << sp << nl << "#ifdef ICE_CPP11_COMPILER"; + H.restoreIndent(); + H << nl << name << "(const " << name << "&) = default;"; + H << nl << name << "& operator=(const " << name << "&) = default;"; + H << nl << "virtual ~" << name << "();"; + + H.zeroIndent(); + H << nl << "#else"; + H.restoreIndent(); + H << nl << "virtual ~" << name << "() throw();"; + + H.zeroIndent(); + H << nl << "#endif"; + H.restoreIndent(); + H << sp; if(!p->isLocal()) @@ -1478,11 +1495,28 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << eb; } - C << sp << nl; + C.zeroIndent(); + C << sp << nl << "#ifdef ICE_CPP11_COMPILER"; + C.restoreIndent(); + + C << nl; + C << scoped.substr(2) << "::~" << name << "()"; + C << sb; + C << eb; + + C.zeroIndent(); + C << nl << "#else"; + C.restoreIndent(); + + C << nl; C << scoped.substr(2) << "::~" << name << "() throw()"; C << sb; C << eb; + C.zeroIndent(); + C << nl << "#endif"; + C.restoreIndent(); + H << nl << "/**"; H << nl << " * Obtains the Slice type ID of this exception."; H << nl << " * @return The fully-scoped type ID."; @@ -2966,6 +3000,21 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) emitOneShotConstructor(p); } + H.zeroIndent(); + H << sp << nl << "#ifdef ICE_CPP11_COMPILER"; + H.restoreIndent(); + if (p->isInterface()) + { + // If this is not an interface it's defined above + H << nl << name << "() = default;"; + } + H << nl << name << "(const " << name << "&) = default;"; + H << nl << name << "& operator=(const " << name << "&) = default;"; + + H.zeroIndent(); + H << nl << "#endif"; + H.restoreIndent(); + if(!p->isLocal()) { C << sp; |