From 27b7175e36b6ac845a1ba542cfe24430fb63a5a2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 9 Apr 2014 09:47:13 +0200 Subject: Clean up function declarations Change-Id: I2478861e79bbb0f6d7e8a0b7bc59a81f457d92dc --- cppu/qa/test_any.cxx | 6 ++---- cppu/qa/test_reference.cxx | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'cppu/qa') diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx index e022f8286266..48dfd753d40b 100644 --- a/cppu/qa/test_any.cxx +++ b/cppu/qa/test_any.cxx @@ -43,6 +43,7 @@ #include "Struct2.hpp" #include "Struct2a.hpp" #include "Struct2b.hpp" +#include "boost/noncopyable.hpp" #include "boost/type_traits/is_same.hpp" #include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Reference.hxx" @@ -59,7 +60,7 @@ namespace { -class Base { +class Base: private boost::noncopyable { public: Base(): m_count(0) {} @@ -79,9 +80,6 @@ protected: virtual ~Base() {} private: - Base(Base &); // not declared - void operator =(Base &); // not declared - oslInterlockedCount m_count; }; diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx index fe3191f629df..15f3b7dac7cc 100644 --- a/cppu/qa/test_reference.cxx +++ b/cppu/qa/test_reference.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -39,7 +40,7 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::UNO_SET_THROW; -class Foo: public Interface1 +class Foo: public Interface1, private boost::noncopyable { public: Foo() @@ -81,10 +82,6 @@ protected: { } -private: - Foo(Foo &); // not declared - Foo& operator =(const Foo&); // not declared - private: oslInterlockedCount m_refCount; }; @@ -92,10 +89,14 @@ private: // Check that the up-casting Reference conversion constructor catches the // intended cases: -struct Base1: public css::uno::XInterface { virtual ~Base1() = 0; }; -struct Base2: public Base1 {}; -struct Base3: public Base1 {}; -struct Derived: public Base2, public Base3 {}; +struct Base1: public css::uno::XInterface { + virtual ~Base1() SAL_DELETED_FUNCTION; +}; +struct Base2: public Base1 { virtual ~Base2() SAL_DELETED_FUNCTION; }; +struct Base3: public Base1 { virtual ~Base3() SAL_DELETED_FUNCTION; }; +struct Derived: public Base2, public Base3 { + virtual ~Derived() SAL_DELETED_FUNCTION; +}; // The special case using the conversion operator instead: css::uno::Reference< css::uno::XInterface > testUpcast1( -- cgit