void RewriteObjC::SynthesizeBlockLiterals(SourceLocation FunLocStart,
const char *FunName) {
// Insert declaration for the function in which block literal is used.
- if (CurFunctionDeclToDeclareForBlock)
+ if (CurFunctionDeclToDeclareForBlock && !Blocks.empty())
RewriteBlockLiteralFunctionDecl(CurFunctionDeclToDeclareForBlock);
// Insert closures that were part of the function.
for (unsigned i = 0; i < Blocks.size(); i++) {
--- /dev/null
+// RUN: %clang_cc1 -x objective-c++ -fblocks -rewrite-objc -o - %s
+// radar 7546096
+
+extern "C" {
+ short foo() { }
+}
+typedef unsigned char Boolean;
+