diff options
author | Jose <jose@zeroc.com> | 2019-06-06 19:24:20 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-06 19:24:20 +0200 |
commit | 2dc0a8799e913bb37db8c5895f00f4dda920df62 (patch) | |
tree | 6dd9fe720314d92fecedb703132c5cf73082ca3f /cpp/src/slice2cpp/Gen.cpp | |
parent | Do not set WindowsTargetPlatformVersion, use the default (diff) | |
download | ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.tar.bz2 ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.tar.xz ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.zip |
Fix Incorrect generated code for class implements interface
Close #406
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 6315c900650..2b65602d59b 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -6740,12 +6740,17 @@ Slice::Gen::Cpp11ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) writeDocSummary(H, p); H << nl << "class " << _dllClassExport << p->name() << "Prx : public virtual " << getUnqualified("::Ice::Proxy", scope) << "<" << fixKwd(p->name() + "Prx") << ", "; - if(bases.empty() || (base && base->allOperations().empty())) + if(bases.empty() || (bases.size() == 1 && base && base->allOperations().empty())) { H << getUnqualified("::Ice::ObjectPrx", scope); } else { + if(base && base->allOperations().empty()) + { + bases.pop_front(); + } + ClassList::const_iterator q = bases.begin(); while(q != bases.end()) { @@ -7870,12 +7875,17 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefStart(const ClassDefPtr& p) writeDocSummary(H, p); H << nl << "class " << _dllExport << name << " : "; H.useCurrentPosAsIndent(); - if(bases.empty() || (base && base->allOperations().empty())) + if(bases.empty() || (base && bases.size() == 1 && base->allOperations().empty())) { H << "public virtual " << getUnqualified("::Ice::Object", scope); } else { + if(base && base->allOperations().empty()) + { + bases.pop_front(); + } + ClassList::const_iterator q = bases.begin(); while(q != bases.end()) { |