[cfe-commits] r133208 - in /cfe/trunk: lib/Sema/SemaExprObjC.cpp test/CodeGenObjC/encode-test.m

Fariborz Jahanian fjahanian at apple.com
Thu Jun 16 15:34:44 PDT 2011


Author: fjahanian
Date: Thu Jun 16 17:34:44 2011
New Revision: 133208

URL: http://llvm.org/viewvc/llvm-project?rev=133208&view=rev
Log:
For the purpose of @encode'ing, accept 'void' type
(even though it is incomplete type) because gcc
says so. // rdar://9622422

Modified:
    cfe/trunk/lib/Sema/SemaExprObjC.cpp
    cfe/trunk/test/CodeGenObjC/encode-test.m

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=133208&r1=133207&r2=133208&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Thu Jun 16 17:34:44 2011
@@ -128,7 +128,8 @@
   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()))

Modified: cfe/trunk/test/CodeGenObjC/encode-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/encode-test.m?rev=133208&r1=133207&r2=133208&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/encode-test.m (original)
+++ cfe/trunk/test/CodeGenObjC/encode-test.m Thu Jun 16 17:34:44 2011
@@ -161,3 +161,7 @@
 
 // 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);





More information about the cfe-commits mailing list