]> granicus.if.org Git - clang/commitdiff
Undo patch for // rdar://10735698
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 6 Mar 2012 18:41:35 +0000 (18:41 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 6 Mar 2012 18:41:35 +0000 (18:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152128 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExpr.cpp
test/Sema/block-missing-return-type-warning.c [deleted file]
test/Sema/warn-unused-parameters.c

index 43992b75021396962e694b5b642c075af0560b19..cb59cbad4f044e03f8b615d2bbadb97d59e26349 100644 (file)
@@ -134,7 +134,6 @@ def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
 def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
-def BlockMissingReturnType : DiagGroup<"block-missing-explicit-return-type">;
 def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
 def Packed : DiagGroup<"packed">;
 def Padded : DiagGroup<"padded">;
index eded154e1162b5e79751c2117221ad43b0f9477d..8499ec0b2a9a84d96b60420c720379b1a6f111b5 100644 (file)
@@ -4953,9 +4953,6 @@ def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
   " or pick a deployment target that supports them">;
 def err_block_returning_array_function : Error<
   "block cannot return %select{array|function}0 type %1">;
-def warn_block_missing_return_type : Warning<
-  "block literal is missing explicit return type and "
-  "returns non-void values">, InGroup<BlockMissingReturnType>, DefaultIgnore;
 
 // Builtin annotation string.
 def err_builtin_annotation_not_string_constant : Error<
index aba38db035248878f449e128bdf367f2de680a04..ab96f7416fe64b489c1a98765d1f4f9bffc97a49 100644 (file)
@@ -8902,12 +8902,7 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
     ExprCleanupObjects.push_back(Result->getBlockDecl());
     ExprNeedsCleanups = true;
   }
-  
-  if (BSI->TheDecl->blockMissingReturnType() &&
-      !RetTy->isDependentType() &&
-      !Context.getCanonicalType(RetTy)->isVoidType())
-    Diag(CaretLoc, diag::warn_block_missing_return_type);
-  
+
   return Owned(Result);
 }
 
diff --git a/test/Sema/block-missing-return-type-warning.c b/test/Sema/block-missing-return-type-warning.c
deleted file mode 100644 (file)
index c029ae6..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks -Wblock-missing-explicit-return-type
-// rdar://10735698
-
-int f;
-int main() {
-  int (^bar)() = ^{  if (f) return 'a'; // expected-warning {{block literal is missing explicit return type and returns non-void values}}
-                      else return 10; 
-                   };
-
-  void (^bar1)() = ^{ f = 100; };
-
-  void (^bar2)() = ^(void){ f = 100; };
-
-  int (^bar3)() = ^ int {  if (f) return 'a';
-                          else return 10;
-                        };
-
-}
index 28a6bcb799c828c6b2decad9736a20c559b7e57d..af048e77e886aea447858822a20398783daa8ee9 100644 (file)
@@ -24,7 +24,7 @@ static void achor() {};
 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything %s 2>&1 | FileCheck -check-prefix=CHECK-everything %s
 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Werror %s 2>&1 | FileCheck -check-prefix=CHECK-everything-error %s
 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Wno-unused %s 2>&1 | FileCheck -check-prefix=CHECK-everything-no-unused %s
-// CHECK-everything: 7 warnings generated
-// CHECK-everything-error: 6 errors generated
-// CHECK-everything-no-unused: 6 warnings generated
+// CHECK-everything: 6 warnings generated
+// CHECK-everything-error: 5 errors generated
+// CHECK-everything-no-unused: 5 warnings generated