forked from OSchip/llvm-project
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:
parent
3b95df8d08
commit
d9bc6c3f59
|
@ -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()))
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue