summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2cs/Gen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 90d3136cbf4..4dc6202c511 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -726,7 +726,11 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
DataMemberList members = p->dataMembers();
DataMemberList classMembers = p->classDataMembers();
ClassList bases = p->bases();
- bool hasBaseClass = !bases.empty() && !bases.front()->isInterface();
+ ClassDefPtr base;
+ if(!bases.empty() && !bases.front()->isInterface())
+ {
+ base = bases.front();
+ }
_out << sp << nl << "#region Marshaling support";
@@ -756,7 +760,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
emitGeneratedCodeAttribute();
}
_out << nl << "public sealed ";
- if(hasBaseClass && bases.front()->declaration()->usesClasses())
+ if(base && !base->allClassDataMembers().empty())
{
_out << "new ";
}