For the purpose of @encode'ing, accept 'void' type

(even though it is incomplete type) because gcc
says so. // rdar://9622422

llvm-svn: 133208
This commit is contained in:
Fariborz Jahanian 2011-06-16 22:34:44 +00:00
parent 3b95df8d08
commit d9bc6c3f59
2 changed files with 6 additions and 1 deletions

View File

@ -128,7 +128,8 @@ ExprResult Sema::BuildObjCEncodeExpression(SourceLocation AtLoc,
if (EncodedType->isDependentType())
StrTy = Context.DependentTy;
else {
if (!EncodedType->getAsArrayTypeUnsafe()) // Incomplete array is handled.
if (!EncodedType->getAsArrayTypeUnsafe() && //// Incomplete array is handled.
!EncodedType->isVoidType()) // void is handled too.
if (RequireCompleteType(AtLoc, EncodedType,
PDiag(diag::err_incomplete_type_objc_at_encode)
<< EncodedTypeInfo->getTypeLoc().getSourceRange()))

View File

@ -161,3 +161,7 @@ struct f
// CHECK: @g10 = constant [14 x i8] c"{f=i[0{?=}]i}\00"
const char g10[] = @encode(struct f);
// rdar://9622422
// CHECK: @g11 = constant [2 x i8] c"v\00"
const char g11[] = @encode(void);