diff options
author | Michi Henning <michi@zeroc.com> | 2002-09-11 05:54:23 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2002-09-11 05:54:23 +0000 |
commit | 62d87cf8f5721b2d322179713d28c40e509bab3f (patch) | |
tree | 89ec4732cbb49b3693e5ebbc5eb596b8ee3490c5 /cpp/src/Slice/Parser.cpp | |
parent | bug fix (diff) | |
download | ice-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.cpp | 7 |
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; |