mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 20:45:06 +00:00
enhance bits_storage to work with enums by using a c-style
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
This commit is contained in:
parent
5938a3e681
commit
47afe4e806
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user