From 2263f822c31d0855ca8c48bfd9624322bf776f0b Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 9 Mar 2010 18:34:52 +0000 Subject: [PATCH] Don't error when a block pointer is passed to a vararg functions/methods. Fixes radar 7725203. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98070 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Type.cpp | 1 + test/SemaObjC/blocks.m | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 76cc382920..8a64f8ea97 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -650,6 +650,7 @@ bool Type::isPODType() const { case Vector: case ExtVector: case ObjCObjectPointer: + case BlockPointer: return true; case Enum: diff --git a/test/SemaObjC/blocks.m b/test/SemaObjC/blocks.m index 3629230973..ddac7d1759 100644 --- a/test/SemaObjC/blocks.m +++ b/test/SemaObjC/blocks.m @@ -55,3 +55,15 @@ int foo9() { } } + +// rdar 7725203 +@class NSString; + +extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); + +void foo10() { + void(^myBlock)(void) = ^{ + }; + NSLog(@"%@", myBlock); +} + -- 2.40.0