summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-09-04 11:14:53 +0800
committerMatthew Newhook <matthew@zeroc.com>2007-09-04 11:14:53 +0800
commita55b88dc20dacaf23c5fce8415daf28c63388ccf (patch)
tree713968abb7de9959600eb59461bd97384b0c4d74 /cpp/src/Slice/CPlusPlusUtil.cpp
parentbug 2442 - slice2java generating bad impl code (diff)
downloadice-a55b88dc20dacaf23c5fce8415daf28c63388ccf.tar.bz2
ice-a55b88dc20dacaf23c5fce8415daf28c63388ccf.tar.xz
ice-a55b88dc20dacaf23c5fce8415daf28c63388ccf.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2369
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 5624801b8e5..03e1a85bc18 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -329,7 +329,7 @@ Slice::inputTypeToString(const TypePtr& type, bool useWstring, const StringList&
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
if(cl)
{
- return "const " + fixKwd(cl->scoped()) + "Ptr&";
+ return "const " + fixKwd(cl->scoped() + "Ptr&");
}
StructPtr st = StructPtr::dynamicCast(type);
@@ -337,7 +337,7 @@ Slice::inputTypeToString(const TypePtr& type, bool useWstring, const StringList&
{
if(findMetaData(st->getMetaData(), false) == "class")
{
- return "const " + fixKwd(st->scoped()) + "Ptr&";
+ return "const " + fixKwd(st->scoped() + "Ptr&");
}
return "const " + fixKwd(st->scoped()) + "&";
}
@@ -345,7 +345,7 @@ Slice::inputTypeToString(const TypePtr& type, bool useWstring, const StringList&
ProxyPtr proxy = ProxyPtr::dynamicCast(type);
if(proxy)
{
- return "const " + fixKwd(proxy->_class()->scoped()) + "Prx&";
+ return "const " + fixKwd(proxy->_class()->scoped() + "Prx&");
}
EnumPtr en = EnumPtr::dynamicCast(type);
@@ -445,7 +445,7 @@ Slice::outputTypeToString(const TypePtr& type, bool useWstring, const StringList
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
if(cl)
{
- return fixKwd(cl->scoped()) + "Ptr&";
+ return fixKwd(cl->scoped() + "Ptr&");
}
StructPtr st = StructPtr::dynamicCast(type);
@@ -453,7 +453,7 @@ Slice::outputTypeToString(const TypePtr& type, bool useWstring, const StringList
{
if(findMetaData(st->getMetaData(), false) == "class")
{
- return fixKwd(st->scoped()) + "Ptr&";
+ return fixKwd(st->scoped() + "Ptr&");
}
return fixKwd(st->scoped()) + "&";
}
@@ -461,7 +461,7 @@ Slice::outputTypeToString(const TypePtr& type, bool useWstring, const StringList
ProxyPtr proxy = ProxyPtr::dynamicCast(type);
if(proxy)
{
- return fixKwd(proxy->_class()->scoped()) + "Prx&";
+ return fixKwd(proxy->_class()->scoped() + "Prx&");
}
SequencePtr seq = SequencePtr::dynamicCast(type);
@@ -526,6 +526,12 @@ lookupKwd(const string& name)
//
// Keyword list. *Must* be kept in alphabetical order.
//
+ // Note that this keyword list unnecessarily contains C++ keywords
+ // that are illegal slice identifiers -- namely identifiers that
+ // contain underscores (and_eq, for example), and slice keywords
+ // (class, int, etc.). They have not been removed so that the
+ // keyword list is kept complete.
+ //
static const string keywordList[] =
{
"and", "and_eq", "asm", "auto", "bit_and", "bit_or", "bool", "break", "case", "catch", "char",