enhance bits_storage to work with enums by using a c-style
authorChris Lattner <sabre@nondot.org>
Tue, 9 Feb 2010 00:05:45 +0000 (00:05 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 Feb 2010 00:05:45 +0000 (00:05 +0000)
cast instead of reinterpret_cast, fixing PR6243.  Apparently
reinterpret_cast and I aren't getting along today.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95622 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/CommandLine.h

index 7f8b10c375f9f1408613bfdb5324cb8270e7c6e5..3ee2313b9a3dca49f2e6b474133642247fc9959d 100644 (file)
@@ -1168,7 +1168,7 @@ class bits_storage<DataType, bool> {
 
   template<class T>
   static unsigned Bit(const T &V) {
-    unsigned BitPos = reinterpret_cast<unsigned>(V);
+    unsigned BitPos = (unsigned)V;
     assert(BitPos < sizeof(unsigned) * CHAR_BIT &&
           "enum exceeds width of bit vector!");
     return 1 << BitPos;