summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp31
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);
+ }
}
// ----------------------------------------------------------------------