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
This commit is contained in:
Jordan Rose 2016-11-11 00:55:14 +00:00
parent ad94840df3
commit b07c0d7085
1 changed files with 4 additions and 0 deletions

View File

@ -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;