From: Jordan Rose Date: Fri, 11 Nov 2016 00:55:14 +0000 (+0000) Subject: Speculative fix for va_list/nullability test on Hexagon and PPC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=534a7a7eedade86800c4cb6f8d0c347f500ec82c;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286533 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index e98737946b..d43d96544e 100644 --- a/lib/Sema/SemaType.cpp +++ b/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()) + T = decayedTy->getOriginalType(); + auto *typedefTy = T->getAs(); if (!typedefTy) return false;