diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-05-25 10:59:11 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-05-25 10:59:11 -0700 |
commit | cb3db5edf1c54f62d9e05cf95d678b3a03cc1367 (patch) | |
tree | aaa9bde0b381ab9e9393e7f89985db2cbb824370 /cpp/src/Slice/Parser.cpp | |
parent | Added support for --no-ipv6 (diff) | |
download | ice-cb3db5edf1c54f62d9e05cf95d678b3a03cc1367.tar.bz2 ice-cb3db5edf1c54f62d9e05cf95d678b3a03cc1367.tar.xz ice-cb3db5edf1c54f62d9e05cf95d678b3a03cc1367.zip |
ICE-7905 - emit warning for interface by value, proxy for class
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 8ecc8c06e43..2b03206c20f 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -113,6 +113,22 @@ isMutableAfterReturnType(const TypePtr& type) return false; } +void +checkDeprecatedType(const UnitPtr& unit, const TypePtr& type) +{ + ClassDeclPtr decl = ClassDeclPtr::dynamicCast(type); + if(decl && !decl->isLocal() && decl->isInterface()) + { + unit->warning(Deprecated, "interface by value is deprecated"); + } + + ProxyPtr proxy = ProxyPtr::dynamicCast(type); + if(proxy && !proxy->_class()->isInterface()) + { + unit->warning(Deprecated, "proxy for a class is deprecated"); + } +} + } namespace Slice @@ -3631,6 +3647,8 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool } } + checkDeprecatedType(_unit, type); + _hasDataMembers = true; DataMemberPtr member = new DataMember(this, name, type, optional, tag, dlt, dv, dl); _contents.push_back(member); @@ -4165,6 +4183,8 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool } } + checkDeprecatedType(_unit, type); + DataMemberPtr p = new DataMember(this, name, type, optional, tag, dlt, dv, dl); _contents.push_back(p); return p; @@ -4487,6 +4507,8 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type, bool op } } + checkDeprecatedType(_unit, type); + DataMemberPtr p = new DataMember(this, name, type, optional, tag, dlt, dv, dl); _contents.push_back(p); return p; @@ -5320,6 +5342,11 @@ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool _unit->error(msg); } + // + // Issue a warning for a deprecated parameter type. + // + checkDeprecatedType(_unit, type); + if(optional) { // @@ -5734,6 +5761,10 @@ Slice::Operation::Operation(const ContainerPtr& container, _returnTag(returnTag), _mode(mode) { + if(returnType) + { + checkDeprecatedType(_unit, returnType); + } } // ---------------------------------------------------------------------- |