summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-01-26 18:12:02 +0100
committerBenoit Foucher <benoit@zeroc.com>2017-01-26 18:12:02 +0100
commitb0f45efeb19159bdda8e62d0abdfc150d50b8c2b (patch)
tree1b1fb7ce858d9cfc9c43f0be4beee97ab1c76d40 /cpp/src/slice2cpp
parentFixed JS tests to run again Ice/exceptions and optionals test with bidir (diff)
downloadice-b0f45efeb19159bdda8e62d0abdfc150d50b8c2b.tar.bz2
ice-b0f45efeb19159bdda8e62d0abdfc150d50b8c2b.tar.xz
ice-b0f45efeb19159bdda8e62d0abdfc150d50b8c2b.zip
Fixed ICE-6920 - Communicator::destroy is now noexcept
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 49db4f74884..b23a22bad3f 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -2987,6 +2987,7 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
argsAMD += "current)";
string isConst = ((p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const")) ? " const" : "";
+ string noExcept = (cl->isLocal() && p->hasMetaData("cpp:noexcept")) ? " throw()" : "";
bool amd = !cl->isLocal() && (cl->hasMetaData("amd") || p->hasMetaData("amd"));
string deprecateSymbol = getDeprecateSymbol(p, cl);
@@ -2994,11 +2995,13 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
H << sp;
if(!amd)
{
- H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << " = 0;";
+ H << nl << deprecateSymbol
+ << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << noExcept << " = 0;";
}
else
{
- H << nl << deprecateSymbol << "virtual void " << name << "_async" << paramsAMD << isConst << " = 0;";
+ H << nl << deprecateSymbol
+ << "virtual void " << name << "_async" << paramsAMD << isConst << noExcept << " = 0;";
}
if(!cl->isLocal())
@@ -4611,6 +4614,10 @@ Slice::Gen::MetaDataVisitor::visitOperation(const OperationPtr& p)
StringList metaData = p->getMetaData();
metaData.remove("cpp:const");
+ if(!cl->isLocal() && p->hasMetaData("cpp:noexcept"))
+ {
+ emitWarning(p->file(), p->line(), "ignoring metadata `cpp:noexcept' for non local interface");
+ }
TypePtr returnType = p->returnType();
if(!metaData.empty())
@@ -6532,11 +6539,12 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p)
args += ')';
string isConst = ((p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const")) ? " const" : "";
+ string noExcept = p->hasMetaData("cpp:noexcept") ? " noexcept" : "";
string deprecateSymbol = getDeprecateSymbol(p, cl);
H << sp;
- H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << " = 0;";
+ H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << noExcept << " = 0;";
if(cl->hasMetaData("async-oneway") || p->hasMetaData("async-oneway"))
{