]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get around a GCC 6 warning.
authorDavid Wells <wellsd2@rpi.edu>
Sat, 7 May 2016 23:28:26 +0000 (19:28 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 8 May 2016 00:45:12 +0000 (20:45 -0400)
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 dbf4030aabc54a11aee4baf69b5c25a557809c5f..e1f47314f41ed85a24641bfec1cca76dc3f3d2db 100644 (file)
@@ -7086,15 +7086,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.