summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Analysis/PrintfFormatString.cpp2
-rw-r--r--clang/test/Sema/format-strings-int-typedefs.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp
index b37b23f3b18..e3d76507cd9 100644
--- a/clang/lib/Analysis/PrintfFormatString.cpp
+++ b/clang/lib/Analysis/PrintfFormatString.cpp
@@ -290,7 +290,7 @@ static QualType FindTypedef(Sema &S, const char *Name, QualType Underlying) {
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;
}
diff --git a/clang/test/Sema/format-strings-int-typedefs.c b/clang/test/Sema/format-strings-int-typedefs.c
index 931449ccc39..2cac9a875d1 100644
--- a/clang/test/Sema/format-strings-int-typedefs.c
+++ b/clang/test/Sema/format-strings-int-typedefs.c
@@ -10,7 +10,7 @@ void test(void) {
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;
OpenPOWER on IntegriCloud