summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index ae8386b2570..1a1337e5922 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3736,8 +3736,12 @@ Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p)
void
Slice::Gen::ObjectDeclVisitor::visitOperation(const OperationPtr& p)
{
- string flatName = p->flattenedScope() + p->name() + "_name";
- C << sp << nl << "const ::std::string " << flatName << " = \"" << p->name() << "\";";
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(p->container());
+ if(cl && !cl->isLocal())
+ {
+ string flatName = p->flattenedScope() + p->name() + "_name";
+ C << sp << nl << "const ::std::string " << flatName << " = \"" << p->name() << "\";";
+ }
}
Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport, bool stream) :