]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add noexcept(false) also to ~GrowingVectorMemory (and its base class)
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 15 Oct 2013 10:10:55 +0000 (10:10 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 15 Oct 2013 10:10:55 +0000 (10:10 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31236 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/subscriptor.h
deal.II/include/deal.II/lac/vector_memory.h
deal.II/source/lac/vector_memory.cc

index f46b7792fa47becae4086c959e080a941054c26a..d546c876e8fdbc9111893f2b509020cda7a65599 100644 (file)
@@ -76,6 +76,12 @@ public:
    * is zero.
    */
 #ifdef DEAL_II_USE_CXX11
+  // 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 ~Subscriptor if we do not annotate it with
+  // "noexcept(false)"
+  // [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3204.htm
   virtual ~Subscriptor() noexcept(false);
 #else
   virtual ~Subscriptor();
index 069ce99e8599e33f245cfd9bb24923ce2a2ab95f..b85c7a3ec2141124a60246ec12d25ad82610bd00 100644 (file)
@@ -80,7 +80,11 @@ public:
    * as there are virtual functions
    * in this class.
    */
-  virtual ~VectorMemory() {}
+#ifdef DEAL_II_USE_CXX11
+  virtual ~VectorMemory () noexcept(false) {}
+#else
+  virtual ~VectorMemory () {}
+#endif
 
   /**
    * Return a pointer to a new
@@ -283,7 +287,11 @@ public:
    * a warning message, if there
    * are allocated vectors left.
    */
-  ~GrowingVectorMemory();
+#ifdef DEAL_II_USE_CXX11
+  virtual ~GrowingVectorMemory() noexcept(false);
+#else
+  virtual ~GrowingVectorMemory();
+#endif
 
   /**
    * Return a pointer to a new
index ecc97a6b0d024edaa56950e4ab56d7bc13b704b1..2ed69eea803887674c646aafb511580f4bcb727e 100644 (file)
@@ -102,7 +102,7 @@ GrowingVectorMemory<VECTOR>::GrowingVectorMemory (const size_type initial_size,
 
 template<typename VECTOR>
 inline
-GrowingVectorMemory<VECTOR>::~GrowingVectorMemory()
+GrowingVectorMemory<VECTOR>::~GrowingVectorMemory() noexcept(false)
 {
   AssertThrow(current_alloc == 0,
               StandardExceptions::ExcMemoryLeak(current_alloc));

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.