diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-16 22:34:44 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-16 22:34:44 +0000 |
| commit | d9bc6c3f593459b62da87ff63d9ce096d4a26031 (patch) | |
| tree | 1072fc89163bfc958fc297ba3a99248ee311f297 | |
| parent | 3b95df8d082c27fb627e0a2cdfcdaed0ad445597 (diff) | |
| download | bcm5719-llvm-d9bc6c3f593459b62da87ff63d9ce096d4a26031.tar.gz bcm5719-llvm-d9bc6c3f593459b62da87ff63d9ce096d4a26031.zip | |
For the purpose of @encode'ing, accept 'void' type
(even though it is incomplete type) because gcc
says so. // rdar://9622422
llvm-svn: 133208
| -rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 3 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/encode-test.m | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 1d1f6aeb348..70eb2a3c727 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -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())) diff --git a/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m index ade0c618225..f30fb26a1e6 100644 --- a/clang/test/CodeGenObjC/encode-test.m +++ b/clang/test/CodeGenObjC/encode-test.m @@ -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); |

