through sugared types when testing for TagTypes. This was the actual
cause of the only false positive in Clang+LLVM.
Next evaluation will be over a much larger selection of code including
large amounts of open source code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131957
91177308-0d34-0410-b5e6-
96231b3b80d8
return;
}
// or one of the types is a tag type.
- if (isa<TagType>(SrcTy) || isa<TagType>(DestTy)) {
+ if (SrcTy->getAs<TagType>() || DestTy->getAs<TagType>()) {
return;
}
void dereference_reinterpret_cast() {
struct A {};
+ typedef A A2;
class B {};
+ typedef B B2;
A a;
B b;
+ A2 a2;
+ B2 b2;
long l;
double d;
float f;
(void)*reinterpret_cast<A*>(&b);
(void)reinterpret_cast<B&>(a);
(void)*reinterpret_cast<B*>(&a);
+ (void)reinterpret_cast<A2&>(b2);
+ (void)*reinterpret_cast<A2*>(&b2);
+ (void)reinterpret_cast<B2&>(a2);
+ (void)*reinterpret_cast<B2*>(&a2);
// Casting to itself is allowed
(void)reinterpret_cast<A&>(a);