Use the canonical type of the typedef to compare with the underlying type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145702
91177308-0d34-0410-b5e6-
96231b3b80d8
if (TypedefDecl *TD = dyn_cast_or_null<TypedefDecl>(D)) {
QualType TypedefType = Ctx.getTypedefType(TD, QualType());
- if (TD->getUnderlyingType() == Underlying)
+ if (Ctx.getCanonicalType(TypedefType) == Underlying)
return TypedefType;
}
printf("%zu", 42.0); // expected-warning {{conversion specifies type 'unsigned long'}}
printf("%td", 42.0); // expected-warning {{conversion specifies type 'int'}}
- typedef __SIZE_TYPE__ size_t;
+ typedef __typeof(sizeof(int)) size_t;
typedef __INTMAX_TYPE__ intmax_t;
typedef __UINTMAX_TYPE__ uintmax_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;