diff options
author | Jose <jose@zeroc.com> | 2017-02-10 12:59:45 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-02-10 12:59:45 +0100 |
commit | e9ff04cb3f82eed72e325f7c51b42e56a9b1daba (patch) | |
tree | 62990984c0e933e348390728f9970bc63127b27f /cpp | |
parent | Fixed (ICE-7540) - IceGridGUI discovers unreachable locators (diff) | |
download | ice-e9ff04cb3f82eed72e325f7c51b42e56a9b1daba.tar.bz2 ice-e9ff04cb3f82eed72e325f7c51b42e56a9b1daba.tar.xz ice-e9ff04cb3f82eed72e325f7c51b42e56a9b1daba.zip |
Emit deprecated warnings for classes implementing interfaces
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 11 | ||||
-rw-r--r-- | cpp/test/Ice/custom/WstringAMDI.h | 4 | ||||
-rw-r--r-- | cpp/test/Ice/custom/WstringI.h | 8 | ||||
-rw-r--r-- | cpp/test/Ice/objects/TestI.h | 7 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.cpp | 15 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.h | 7 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.cpp | 14 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.h | 7 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Twoways.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Ice/optional/TestAMDI.h | 7 | ||||
-rw-r--r-- | cpp/test/Ice/optional/TestI.h | 7 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/TestAMDI.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/TestAMDI.h | 7 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/TestI.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/TestI.h | 7 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/ClassRedefinition.err | 4 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/ClassRedefinition.ice | 9 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/IllegalLocal.err | 2 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/IllegalLocal.ice | 2 | ||||
-rw-r--r-- | cpp/test/Slice/escape/Client.cpp | 16 | ||||
-rw-r--r-- | cpp/test/Slice/escape/Key.ice | 2 |
21 files changed, 47 insertions, 97 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index de6ad85bb96..ca774ef54a8 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -3954,6 +3954,17 @@ Slice::ClassDef::ClassDef(const ContainerPtr& container, const string& name, int _local(local), _compactId(id) { + if(!local && !intf) + { + for(ClassList::const_iterator p = _bases.begin(); p != _bases.end(); ++p) + { + if((*p)->isInterface()) + { + _unit->warning(Deprecated, "classes implementing interfaces are deprecated"); + break; + } + } + } // // First element of bases may be a class, all others must be // interfaces. diff --git a/cpp/test/Ice/custom/WstringAMDI.h b/cpp/test/Ice/custom/WstringAMDI.h index a53e389fe3d..1af66349311 100644 --- a/cpp/test/Ice/custom/WstringAMDI.h +++ b/cpp/test/Ice/custom/WstringAMDI.h @@ -16,7 +16,7 @@ namespace Test1 { #ifdef ICE_CPP11_MAPPING -class WstringClassI : public virtual WstringClassDisp +class WstringClassI : public virtual WstringClass { public: @@ -55,7 +55,7 @@ public: namespace Test2 { #ifdef ICE_CPP11_MAPPING -class WstringClassI : public virtual WstringClassDisp +class WstringClassI : public virtual WstringClass { public: diff --git a/cpp/test/Ice/custom/WstringI.h b/cpp/test/Ice/custom/WstringI.h index 849e05aa16f..4836be95a66 100644 --- a/cpp/test/Ice/custom/WstringI.h +++ b/cpp/test/Ice/custom/WstringI.h @@ -15,11 +15,7 @@ namespace Test1 { -#ifdef ICE_CPP11_MAPPING -class WstringClassI : public virtual WstringClassDisp -#else class WstringClassI : public virtual WstringClass -#endif { public: @@ -40,11 +36,7 @@ public: namespace Test2 { -#ifdef ICE_CPP11_MAPPING -class WstringClassI : public virtual WstringClassDisp -#else class WstringClassI : public virtual WstringClass -#endif { public: diff --git a/cpp/test/Ice/objects/TestI.h b/cpp/test/Ice/objects/TestI.h index 473c7b40bbf..5f61f3a583c 100644 --- a/cpp/test/Ice/objects/TestI.h +++ b/cpp/test/Ice/objects/TestI.h @@ -80,12 +80,7 @@ class HI : public Test::H { }; -class InitialI : -#ifdef ICE_CPP11_MAPPING - public Test::InitialDisp -#else - public Test::Initial -#endif +class InitialI : public Test::Initial { public: diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index baea3211706..57eb91887de 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -27,7 +27,7 @@ MyDerivedClassI::ice_isA(ICE_IN(string) id, const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); #ifdef ICE_CPP11_MAPPING - return Test::MyDerivedClassDisp::ice_isA(move(id), current); + return Test::MyDerivedClass::ice_isA(move(id), current); #else return Test::MyDerivedClass::ice_isA(id, current); #endif @@ -37,22 +37,15 @@ void MyDerivedClassI::ice_ping(const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); -#ifdef ICE_CPP11_MAPPING - Test::MyDerivedClassDisp::ice_ping(current); -#else Test::MyDerivedClass::ice_ping(current); -#endif + } std::vector<std::string> MyDerivedClassI::ice_ids(const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); -#ifdef ICE_CPP11_MAPPING - return Test::MyDerivedClassDisp::ice_ids(current); -#else return Test::MyDerivedClass::ice_ids(current); -#endif } #ifdef ICE_CPP11_MAPPING @@ -63,11 +56,7 @@ const std::string& MyDerivedClassI::ice_id(const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); -#ifdef ICE_CPP11_MAPPING - return Test::MyDerivedClassDisp::ice_id(current); -#else return Test::MyDerivedClass::ice_id(current); -#endif } #ifdef ICE_CPP11_MAPPING diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index 38cea8022f9..011c800adde 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -14,12 +14,7 @@ #include <TestAMD.h> #include <TestCommon.h> -class MyDerivedClassI : -#ifdef ICE_CPP11_MAPPING - public Test::MyDerivedClassDisp -#else - public Test::MyDerivedClass -#endif +class MyDerivedClassI : public Test::MyDerivedClass { public: diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index 2adfceda6db..ba4c5c5654c 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -28,7 +28,7 @@ MyDerivedClassI::ice_isA(ICE_IN(string) id, const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); #ifdef ICE_CPP11_MAPPING - return Test::MyDerivedClassDisp::ice_isA(move(id), current); + return Test::MyDerivedClass::ice_isA(move(id), current); #else return Test::MyDerivedClass::ice_isA(id, current); #endif @@ -38,22 +38,14 @@ void MyDerivedClassI::ice_ping(const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); -#ifdef ICE_CPP11_MAPPING - Test::MyDerivedClassDisp::ice_ping(current); -#else Test::MyDerivedClass::ice_ping(current); -#endif } std::vector<std::string> MyDerivedClassI::ice_ids(const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); -#ifdef ICE_CPP11_MAPPING - return Test::MyDerivedClassDisp::ice_ids(current); -#else return Test::MyDerivedClass::ice_ids(current); -#endif } #ifdef ICE_CPP11_MAPPING @@ -64,11 +56,7 @@ const std::string& MyDerivedClassI::ice_id(const Ice::Current& current) const { test(current.mode == ICE_ENUM(OperationMode, Nonmutating)); -#ifdef ICE_CPP11_MAPPING - return Test::MyDerivedClassDisp::ice_id(current); -#else return Test::MyDerivedClass::ice_id(current); -#endif } void diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 83a364fdc69..f53606e8ffa 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -13,12 +13,7 @@ #include <Test.h> #include <TestCommon.h> -class MyDerivedClassI : -#ifdef ICE_CPP11_MAPPING - public Test::MyDerivedClassDisp -#else - public Test::MyDerivedClass -#endif +class MyDerivedClassI : public Test::MyDerivedClass { public: diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 6e8d963f798..f9e7ba152ca 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -233,11 +233,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) } { -#ifdef ICE_CPP11_MAPPING - test(Test::MyClassPrx::ice_staticId() == Test::MyClassDisp::ice_staticId()); -#else test(Test::MyClassPrx::ice_staticId() == Test::MyClass::ice_staticId()); -#endif test(Ice::ObjectPrx::ice_staticId() == Ice::Object::ice_staticId()); } diff --git a/cpp/test/Ice/optional/TestAMDI.h b/cpp/test/Ice/optional/TestAMDI.h index 48bbe84452e..64793f42d17 100644 --- a/cpp/test/Ice/optional/TestAMDI.h +++ b/cpp/test/Ice/optional/TestAMDI.h @@ -13,12 +13,7 @@ #include <TestAMD.h> -class InitialI : -#ifdef ICE_CPP11_MAPPING - public Test::InitialDisp -#else - public Test::Initial -#endif +class InitialI : public Test::Initial { public: diff --git a/cpp/test/Ice/optional/TestI.h b/cpp/test/Ice/optional/TestI.h index b6fcdeb9dfc..38050948cf9 100644 --- a/cpp/test/Ice/optional/TestI.h +++ b/cpp/test/Ice/optional/TestI.h @@ -20,12 +20,7 @@ using OneOptionalPrxPtr = std::shared_ptr<Ice::ObjectPrx>; #endif -class InitialI : -#ifdef ICE_CPP11_MAPPING - public Test::InitialDisp -#else - public Test::Initial -#endif +class InitialI : public Test::Initial { public: diff --git a/cpp/test/Ice/proxy/TestAMDI.cpp b/cpp/test/Ice/proxy/TestAMDI.cpp index 968ab15ad3a..9def18d0610 100644 --- a/cpp/test/Ice/proxy/TestAMDI.cpp +++ b/cpp/test/Ice/proxy/TestAMDI.cpp @@ -50,7 +50,7 @@ bool MyDerivedClassI::ice_isA(string s, const Ice::Current& current) const { _ctx = current.ctx; - return Test::MyDerivedClassDisp::ice_isA(move(s), current); + return Test::MyDerivedClass::ice_isA(move(s), current); } #else void diff --git a/cpp/test/Ice/proxy/TestAMDI.h b/cpp/test/Ice/proxy/TestAMDI.h index 3f9d5aac1bf..5a558c120a5 100644 --- a/cpp/test/Ice/proxy/TestAMDI.h +++ b/cpp/test/Ice/proxy/TestAMDI.h @@ -12,12 +12,7 @@ #include <TestAMD.h> -class MyDerivedClassI : -#ifdef ICE_CPP11_MAPPING - public Test::MyDerivedClassDisp -#else - public Test::MyDerivedClass -#endif +class MyDerivedClassI : public Test::MyDerivedClass { public: diff --git a/cpp/test/Ice/proxy/TestI.cpp b/cpp/test/Ice/proxy/TestI.cpp index bc4a2ff971f..afc666b0ef7 100644 --- a/cpp/test/Ice/proxy/TestI.cpp +++ b/cpp/test/Ice/proxy/TestI.cpp @@ -48,7 +48,7 @@ bool MyDerivedClassI::ice_isA(string s, const Ice::Current& current) const { _ctx = current.ctx; - return Test::MyDerivedClassDisp::ice_isA(move(s), current); + return Test::MyDerivedClass::ice_isA(move(s), current); } #else bool diff --git a/cpp/test/Ice/proxy/TestI.h b/cpp/test/Ice/proxy/TestI.h index 6a5c1323bb9..eb2a5a557bd 100644 --- a/cpp/test/Ice/proxy/TestI.h +++ b/cpp/test/Ice/proxy/TestI.h @@ -12,12 +12,7 @@ #include <Test.h> -class MyDerivedClassI : -#ifdef ICE_CPP11_MAPPING - public Test::MyDerivedClassDisp -#else - public Test::MyDerivedClass -#endif +class MyDerivedClassI : public Test::MyDerivedClass { public: diff --git a/cpp/test/Slice/errorDetection/ClassRedefinition.err b/cpp/test/Slice/errorDetection/ClassRedefinition.err index 483961ff9e0..d50418a4237 100644 --- a/cpp/test/Slice/errorDetection/ClassRedefinition.err +++ b/cpp/test/Slice/errorDetection/ClassRedefinition.err @@ -1,2 +1,2 @@ -ClassRedefinition.ice:18: redefinition of class `Class1' -ClassRedefinition.ice:22: redefinition of class `Class2' +ClassRedefinition.ice:17: redefinition of class `Class1' +ClassRedefinition.ice:21: redefinition of class `Class2' diff --git a/cpp/test/Slice/errorDetection/ClassRedefinition.ice b/cpp/test/Slice/errorDetection/ClassRedefinition.ice index b6162e19edd..953b0f75cf2 100644 --- a/cpp/test/Slice/errorDetection/ClassRedefinition.ice +++ b/cpp/test/Slice/errorDetection/ClassRedefinition.ice @@ -12,13 +12,12 @@ module Test { -interface Foo { long op(); }; -class Class1 implements Foo { byte b; long l; }; +class Class1 { byte b; long l; }; class Class1; -class Class1 implements Foo { long l; }; +class Class1 { long l; }; -class Class2 implements Foo { byte b; }; +class Class2 { byte b; }; class Class2; -class Class2 implements Foo { byte b; }; +class Class2 { byte b; }; }; diff --git a/cpp/test/Slice/errorDetection/IllegalLocal.err b/cpp/test/Slice/errorDetection/IllegalLocal.err index 3acc9aa5e5c..939af203014 100644 --- a/cpp/test/Slice/errorDetection/IllegalLocal.err +++ b/cpp/test/Slice/errorDetection/IllegalLocal.err @@ -1,6 +1,8 @@ IllegalLocal.ice:17: local interface `i2' cannot have non-local base interface `i1' IllegalLocal.ice:19: non-local interface `i3' cannot have local base interface `i2' +IllegalLocal.ice:23: warning: classes implementing interfaces are deprecated IllegalLocal.ice:25: non-local class `c2' cannot have local base interface `i2' +IllegalLocal.ice:25: warning: classes implementing interfaces are deprecated IllegalLocal.ice:31: non-local interface `i' cannot have operation `op' throwing local exception `le' IllegalLocal.ice:34: non-local exception `le2' cannot have local base exception `le' IllegalLocal.ice:40: non-local class`c3' cannot contain local member `lo1' diff --git a/cpp/test/Slice/errorDetection/IllegalLocal.ice b/cpp/test/Slice/errorDetection/IllegalLocal.ice index 94152454594..b3619e3cd94 100644 --- a/cpp/test/Slice/errorDetection/IllegalLocal.ice +++ b/cpp/test/Slice/errorDetection/IllegalLocal.ice @@ -20,7 +20,7 @@ interface i3 extends i2 {}; // error local interface i4 extends i2 {}; // OK -class c1 implements i1 {}; // OK +class c1 implements i1 {}; // Warning class c2 implements i2 {}; // error diff --git a/cpp/test/Slice/escape/Client.cpp b/cpp/test/Slice/escape/Client.cpp index a237be77858..d5c2c5b734d 100644 --- a/cpp/test/Slice/escape/Client.cpp +++ b/cpp/test/Slice/escape/Client.cpp @@ -64,10 +64,10 @@ class doI : public _cpp_and::_cpp_do { public: #ifdef ICE_CPP11_MAPPING - virtual void caseAsync(::Ice::Int, - function<void(int)>, - function<void(const exception_ptr&)>, - const ::Ice::Current&) + virtual void caseAsync(int, + ::std::function<void(int)>, + ::std::function<void(::std::exception_ptr)>, + const ::Ice::Current&) { } #else @@ -95,10 +95,18 @@ public: const _cpp_and::deletePtr&, #endif const _cpp_and::switchPtr&, +#ifdef ICE_CPP11_MAPPING + const ::std::shared_ptr<::Ice::Value>&, +#else const _cpp_and::doPtr&, +#endif const _cpp_and::breakPrxPtr&, const _cpp_and::charPrxPtr&, +#ifdef ICE_CPP11_MAPPING + const ::std::shared_ptr<::Ice::ObjectPrx>&, +#else const _cpp_and::switchPrxPtr&, +#endif const _cpp_and::doPrxPtr&, ::Ice::Int, ::Ice::Int, ::Ice::Int, ::Ice::Int) diff --git a/cpp/test/Slice/escape/Key.ice b/cpp/test/Slice/escape/Key.ice index a5f27867aae..2fb1e71adbb 100644 --- a/cpp/test/Slice/escape/Key.ice +++ b/cpp/test/Slice/escape/Key.ice @@ -44,7 +44,7 @@ class switch int volatile; }; -class do extends switch implements char, break +interface do extends char, break { }; |