From 2af89404910bca4de201febf21368d1f9b841bfa Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 15 Oct 2013 10:02:46 +0000 Subject: [PATCH] Bugfix: Propagate exceptions out of ~Subscriptor in C++11 mode According to the C++11 standard [class.dtor] 3 in combination with [except.spec] 14 and [except.spec] 9---as explained in detail in [1]---we're guilty of just terminating in case of throwing an exception in a destructor. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3204.htm git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31235 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/function_time.h | 4 ++++ deal.II/include/deal.II/base/subscriptor.h | 4 ++++ deal.II/source/base/function_time.cc | 4 ++++ deal.II/source/base/subscriptor.cc | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/deal.II/include/deal.II/base/function_time.h b/deal.II/include/deal.II/base/function_time.h index 3615f51f73..2b17d0f29f 100644 --- a/deal.II/include/deal.II/base/function_time.h +++ b/deal.II/include/deal.II/base/function_time.h @@ -77,7 +77,11 @@ public: /** * Virtual destructor. */ +#ifdef DEAL_II_USE_CXX11 + virtual ~FunctionTime() noexcept(false); +#else virtual ~FunctionTime(); +#endif /** * Return the value of the time variable/ diff --git a/deal.II/include/deal.II/base/subscriptor.h b/deal.II/include/deal.II/base/subscriptor.h index 44d425865c..f46b7792fa 100644 --- a/deal.II/include/deal.II/base/subscriptor.h +++ b/deal.II/include/deal.II/base/subscriptor.h @@ -75,7 +75,11 @@ public: * Destructor, asserting that the counter * is zero. */ +#ifdef DEAL_II_USE_CXX11 + virtual ~Subscriptor() noexcept(false); +#else virtual ~Subscriptor(); +#endif /** * Assignment operator. diff --git a/deal.II/source/base/function_time.cc b/deal.II/source/base/function_time.cc index b726a6551e..2f409b0761 100644 --- a/deal.II/source/base/function_time.cc +++ b/deal.II/source/base/function_time.cc @@ -26,7 +26,11 @@ FunctionTime::FunctionTime(const double initial_time) +#ifdef DEAL_II_USE_CXX11 +FunctionTime::~FunctionTime() noexcept(false) +#else FunctionTime::~FunctionTime() +#endif {} diff --git a/deal.II/source/base/subscriptor.cc b/deal.II/source/base/subscriptor.cc index fa2af252e4..b9af279a91 100644 --- a/deal.II/source/base/subscriptor.cc +++ b/deal.II/source/base/subscriptor.cc @@ -57,7 +57,11 @@ Subscriptor::Subscriptor (const Subscriptor &) {} +#ifdef DEAL_II_USE_CXX11 +Subscriptor::~Subscriptor () noexcept(false) +#else Subscriptor::~Subscriptor () +#endif { // check whether there are still // subscriptions to this object. if -- 2.39.5