summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2016-11-11 00:55:14 +0000
committerJordan Rose <jordan_rose@apple.com>2016-11-11 00:55:14 +0000
commitb07c0d7085fc35c2891a21dd4170c26eb6f6d1bd (patch)
tree920528af4481209b43d9b70de3e682bc0a6f80e4 /clang/lib
parentad94840df31843d043ec9ad4f20bd076d23f9f17 (diff)
downloadbcm5719-llvm-b07c0d7085fc35c2891a21dd4170c26eb6f6d1bd.tar.gz
bcm5719-llvm-b07c0d7085fc35c2891a21dd4170c26eb6f6d1bd.zip
Speculative fix for va_list/nullability test on Hexagon and PPC.
PowerPC's va_list, at least, is a typedef for an array, which means it decays to a pointer in parameter position. Since the decayed type is built from the array element type, the typedef sugar is lost. More rdar://problem/25846421. llvm-svn: 286533
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaType.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index e98737946b7..d43d96544e9 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -3921,6 +3921,10 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
}
auto isVaList = [&S](QualType T) -> bool {
+ // Handle array va_list parameters that decayed to pointers.
+ if (auto *decayedTy = T->getAs<DecayedType>())
+ T = decayedTy->getOriginalType();
+
auto *typedefTy = T->getAs<TypedefType>();
if (!typedefTy)
return false;
OpenPOWER on IntegriCloud