Skip to content

Commit b07c0d7

Browse files
committed
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
1 parent ad94840 commit b07c0d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/Sema/SemaType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,6 +3921,10 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
39213921
}
39223922

39233923
auto isVaList = [&S](QualType T) -> bool {
3924+
// Handle array va_list parameters that decayed to pointers.
3925+
if (auto *decayedTy = T->getAs<DecayedType>())
3926+
T = decayedTy->getOriginalType();
3927+
39243928
auto *typedefTy = T->getAs<TypedefType>();
39253929
if (!typedefTy)
39263930
return false;

0 commit comments

Comments
 (0)