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

--

PiperOrigin-RevId: 244070052

mlir/include/mlir/IR/Location.h

index 57dcce2..efcee49 100644 (file)
@@ -107,7 +107,7 @@ public:
     return static_cast<const void *>(loc);
   }
   static Location getFromOpaquePointer(const void *pointer) {
-    return Location((ImplType *)(pointer));
+    return Location(reinterpret_cast<ImplType *>(const_cast<void *>(pointer)));
   }
 
 protected: