diff options
author | Michi Henning <michi@zeroc.com> | 2009-01-28 08:06:14 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2009-01-28 08:06:14 +1000 |
commit | a7b39fcf26f3335fbf6f4ba65534c1d82c4bcd24 (patch) | |
tree | 2b4d443b63df07d2ad4a07e00b3ffcc98eb922b1 /cpp/src | |
parent | Squashed commit of the following: (diff) | |
download | ice-a7b39fcf26f3335fbf6f4ba65534c1d82c4bcd24.tar.bz2 ice-a7b39fcf26f3335fbf6f4ba65534c1d82c4bcd24.tar.xz ice-a7b39fcf26f3335fbf6f4ba65534c1d82c4bcd24.zip |
Squashed commit of the following:
commit e2472df68af6933320425f6ef65f7234e988e77c
Author: michi <michi@michi.local>
Date: Wed Jan 28 08:05:19 2009 +1000
Bug 3677. Follow-up fix that fixes bad code in C++ if a class whose name is a keyword contains data members.
Also fixed same problem with slice2java. Added test case for all language mappings.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 3 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 22a033421c6..f990ccdf38a 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -4460,7 +4460,8 @@ Slice::Gen::ObjectVisitor::emitOneShotConstructor(const ClassDefPtr& p) if(!allDataMembers.empty()) { - C << sp << nl << p->scoped().substr(2) << "::" << fixKwd(p->name()) << spar << allParamDecls << epar << " :"; + C << sp << nl << fixKwd(p->scoped()).substr(2) << "::" << fixKwd(p->name()) + << spar << allParamDecls << epar << " :"; C.inc(); DataMemberList dataMembers = p->dataMembers(); diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index ab9cc42aed4..0a9a6616a8c 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -1837,7 +1837,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) // Constructors. // out << sp; - out << nl << "public " << name << "()"; + out << nl << "public " << fixKwd(name) << "()"; out << sb; if(baseClass) { @@ -1845,7 +1845,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) } out << eb; - out << sp << nl << "public " << name << spar; + out << sp << nl << "public " << fixKwd(name) << spar; vector<string> paramDecl; for(d = allDataMembers.begin(); d != allDataMembers.end(); ++d) { |