diff options
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 7df3db344dc..748b018d952 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -1418,9 +1418,16 @@ Slice::Container::checkPrefix(const string& name) const { if(_unit->currentIncludeLevel() == 0 && !_unit->allowIcePrefix()) { - if(name.find("Ice", 0) == 0) + if(name.size() >= 3) { - _unit->error("illegal identifier `" + name + "': `Ice' prefix is reserved"); + string prefix3; + prefix3 += tolower(name[0]); + prefix3 += tolower(name[1]); + prefix3 += tolower(name[2]); + if(prefix3 == "ice") + { + _unit->error("illegal identifier `" + name + "': `" + name.substr(0, 3) + "' prefix is reserved"); + } } } } |