Use proper C++ casts in Types.h
authorNicolas Vasilache <ntv@google.com>
Wed, 17 Apr 2019 21:41:33 +0000 (14:41 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 18 Apr 2019 18:49:55 +0000 (11:49 -0700)
    This CL reduces the amount of warning spew when compiling with CMake on Linux.

--

PiperOrigin-RevId: 244070668

mlir/include/mlir/IR/Types.h

index e207291..951259b 100644 (file)
@@ -241,7 +241,7 @@ public:
     return static_cast<const void *>(type);
   }
   static Type getFromOpaquePointer(const void *pointer) {
-    return Type((ImplType *)(pointer));
+    return Type(reinterpret_cast<ImplType *>(const_cast<void *>(pointer)));
   }
 
 protected: