From ddcc98fa50dd9d86a60dada4daa00f4d95ffe005 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 22 Jul 2020 13:41:12 +0200 Subject: Remove obsolete dynamic exception specifications from SDK example C++ code GCC 11 trunk g++ defaults to C++17 now, so that CustomTarget_odk/build-examples and CustomTarget_odk/build-examples_java would now fail with "error: ISO C++17 does not allow dynamic exception specifications". 550e0e42d9ccef1244299b2d6cbda18549f8af19 "Remove dynamic exception specifications from cppumaker-generated code" had long since removed the exception specifications from the underlying (C++ classes representing) UNO interface types, so just remove them from the SDK example code, too. An alternative would have been to make sure those CustomTarget use an old C++ compiler standard. However, testing that the examples work against a new standard has probably similar merit to testing that they keep working against some obsolete standard. Change-Id: I8ec9ac2f9ced7bd1b746fb00d9bce94bf6aedda5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99218 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- odk/examples/cpp/counter/counter.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'odk/examples/cpp/counter/counter.cxx') diff --git a/odk/examples/cpp/counter/counter.cxx b/odk/examples/cpp/counter/counter.cxx index 7e16b6a10838..c45546889285 100644 --- a/odk/examples/cpp/counter/counter.cxx +++ b/odk/examples/cpp/counter/counter.cxx @@ -86,43 +86,40 @@ public: { ++m_nRefCount; } virtual void SAL_CALL release() throw () { if (! --m_nRefCount) delete this; } - virtual Any SAL_CALL queryInterface( const Type & rType ) throw (RuntimeException) + virtual Any SAL_CALL queryInterface( const Type & rType ) { return cppu::queryInterface(rType, static_cast< XInterface* >( static_cast< XServiceInfo* >( this ) ), static_cast< XCountable* >( this ), static_cast< XServiceInfo* >( this ) ); } // XServiceInfo implementation - virtual OUString SAL_CALL getImplementationName( ) throw(RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException); - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(RuntimeException); + virtual OUString SAL_CALL getImplementationName( ); + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ); + virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ); static Sequence< OUString > SAL_CALL getSupportedServiceNames_Static( ); // XCountable implementation - virtual sal_Int32 SAL_CALL getCount() throw (RuntimeException) + virtual sal_Int32 SAL_CALL getCount() { return m_nCount; } - virtual void SAL_CALL setCount( sal_Int32 nCount ) throw (RuntimeException) + virtual void SAL_CALL setCount( sal_Int32 nCount ) { m_nCount = nCount; } - virtual sal_Int32 SAL_CALL increment() throw (RuntimeException) + virtual sal_Int32 SAL_CALL increment() { return (++m_nCount); } - virtual sal_Int32 SAL_CALL decrement() throw (RuntimeException) + virtual sal_Int32 SAL_CALL decrement() { return (--m_nCount); } }; OUString SAL_CALL MyCounterImpl::getImplementationName( ) - throw(RuntimeException) { return OUString( IMPLNAME ); } sal_Bool SAL_CALL MyCounterImpl::supportsService( const OUString& ServiceName ) - throw(RuntimeException) { return cppu::supportsService(this, ServiceName); } Sequence SAL_CALL MyCounterImpl::getSupportedServiceNames( ) - throw(RuntimeException) { return getSupportedServiceNames_Static(); } -- cgit