]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Propagate exceptions out of ~Subscriptor in C++11 mode
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 15 Oct 2013 10:02:46 +0000 (10:02 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 15 Oct 2013 10:02:46 +0000 (10:02 +0000)
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
deal.II/include/deal.II/base/subscriptor.h
deal.II/source/base/function_time.cc
deal.II/source/base/subscriptor.cc

index 3615f51f73a30042aec1c31a20d3dec39c4824aa..2b17d0f29fc410490a8b1ac67abb29f95c0a4df4 100644 (file)
@@ -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/
index 44d425865c4bf61a6f85fff08b5a2a867efe580c..f46b7792fa47becae4086c959e080a941054c26a 100644 (file)
@@ -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.
index b726a6551e57d7281b987f92d984267c0f1ab355..2f409b0761203759ccd973a89c50e68c8a7f5392 100644 (file)
@@ -26,7 +26,11 @@ FunctionTime::FunctionTime(const double initial_time)
 
 
 
+#ifdef DEAL_II_USE_CXX11
+FunctionTime::~FunctionTime() noexcept(false)
+#else
 FunctionTime::~FunctionTime()
+#endif
 {}
 
 
index fa2af252e4140a848fa2c537dfe7244a21d72757..b9af279a917df3a54fdd4195fb2bc3eae9a81262 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.