diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 7aefe066ea3..0d8517d42d2 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3397,11 +3397,18 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) H << nl << "public:" << sp; H.inc(); - if(!p->isLocal()) + // + // In C++, a nested type cannot have the same name as the enclosing type + // + if(!p->isLocal() && p->name() != "ProxyType") { H << nl << "typedef " << p->name() << "Prx ProxyType;"; } - H << nl << "typedef " << p->name() << "Ptr PointerType;"; + + if(p->name() != "PointerType") + { + H << nl << "typedef " << p->name() << "Ptr PointerType;"; + } vector<string> params; vector<string> allTypes; |