summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-09-11 05:54:23 +0000
committerMichi Henning <michi@zeroc.com>2002-09-11 05:54:23 +0000
commit62d87cf8f5721b2d322179713d28c40e509bab3f (patch)
tree89ec4732cbb49b3693e5ebbc5eb596b8ee3490c5 /cpp/src/Slice/Parser.cpp
parentbug fix (diff)
downloadice-62d87cf8f5721b2d322179713d28c40e509bab3f.tar.bz2
ice-62d87cf8f5721b2d322179713d28c40e509bab3f.tar.xz
ice-62d87cf8f5721b2d322179713d28c40e509bab3f.zip
Fixed incorrect diagnostic if a structure contained itself: the name of the
member appeared in the error message instead of the name of the type of the member. Changed semantic check for introduced types to be more stringent: it is now case-insensitive. Previously, we were incorrectly allowing the following: sequence<int> IS; struct x { IS is; };
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index 0f070a1735c..09994110aca 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -1329,7 +1329,7 @@ Slice::Container::checkIntroduced(const string& scoped, ContainedPtr namedThing)
//
// Check if we have the introduced name in the map already...
//
- map<string, ContainedPtr>::const_iterator it = _introducedMap.find(firstComponent);
+ map<string, ContainedPtr, CICompare>::const_iterator it = _introducedMap.find(firstComponent);
if(it == _introducedMap.end())
{
_introducedMap[firstComponent] = namedThing; // No, insert it
@@ -2436,10 +2436,13 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type)
_unit->error(msg);
}
+ //
+ // Structures cannot contain themselves
+ //
if(type.get() == this)
{
string msg = "struct `";
- msg += name;
+ msg += this->name();
msg += "' cannot contain itself";
_unit->error(msg);
return 0;