зеркало из https://github.com/microsoft/clang-1.git
Do not do the block-specific rewrite when there is no block literals.
Fixes radar 7546096. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93519 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
501edb6a54
Коммит
bf07012cf9
|
@ -4043,7 +4043,7 @@ std::string RewriteObjC::SynthesizeBlockDescriptor(std::string DescTag,
|
|||
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++) {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// RUN: %clang_cc1 -x objective-c++ -fblocks -rewrite-objc -o - %s
|
||||
// radar 7546096
|
||||
|
||||
extern "C" {
|
||||
short foo() { }
|
||||
}
|
||||
typedef unsigned char Boolean;
|
||||
|
Загрузка…
Ссылка в новой задаче