]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get around a GCC 6 warning. 3046/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 7 May 2016 23:28:26 +0000 (19:28 -0400)
committerMatthias Maier <tamiko@43-1.org>
Thu, 1 Sep 2016 00:01:17 +0000 (19:01 -0500)
GCC 6.1 now warns (-Waddress) that (since the dynamic cast of an object
back to its own type always succeeds) the address of an object is always
nonzero, so these casts result in tautologies for valid vector types.

include/deal.II/numerics/vector_tools.templates.h

index e6889a36b415401d333bc4168cf0070d087ee451..e1af4962ca8f224013b887cbb3c58101bbb3862a 100644 (file)
@@ -6972,15 +6972,8 @@ namespace VectorTools
       }
     else
       {
-        // This function is not implemented for distributed vectors, so
-        // if v is not a boring Vector or BlockVector:
-        Assert(   dynamic_cast<Vector<double> *>(& v)
-                  || dynamic_cast<Vector<float> *>(& v)
-                  || dynamic_cast<Vector<long double> *>(& v)
-                  || dynamic_cast<BlockVector<double> *>(& v)
-                  || dynamic_cast<BlockVector<float> *>(& v)
-                  || dynamic_cast<BlockVector<long double> *>(& v),
-                  ExcNotImplemented());
+        // This function is not implemented for distributed vectors.
+        Assert(!v.supports_distributed_data, ExcNotImplemented());
 
         const unsigned int n = v.size();
 

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.