Index: lib/Analysis/RetainSummaryManager.cpp =================================================================== --- lib/Analysis/RetainSummaryManager.cpp +++ lib/Analysis/RetainSummaryManager.cpp @@ -722,12 +722,13 @@ // These are not retain. They just return something and retain it. return None; } - if (cocoa::isRefType(ResultTy, "CF", FName) || - cocoa::isRefType(ResultTy, "CG", FName) || - cocoa::isRefType(ResultTy, "CV", FName)) - if (isRetain(FD, FName) || isAutorelease(FD, FName) || - isMakeCollectable(FName)) - return BehaviorSummary::Identity; + if (CE->getNumArgs() == 1 && + (cocoa::isRefType(ResultTy, "CF", FName) || + cocoa::isRefType(ResultTy, "CG", FName) || + cocoa::isRefType(ResultTy, "CV", FName)) && + (isRetain(FD, FName) || isAutorelease(FD, FName) || + isMakeCollectable(FName))) + return BehaviorSummary::Identity; // safeMetaCast is called by OSDynamicCast. // We assume that OSDynamicCast is either an identity (cast is OK, Index: test/Analysis/retain-release.mm =================================================================== --- test/Analysis/retain-release.mm +++ test/Analysis/retain-release.mm @@ -503,3 +503,15 @@ } } + +namespace yet_another_unexpected_signature_crash { + +CFTypeRef CFSomethingSomethingRetain(); +CFTypeRef CFSomethingSomethingAutorelease(); + +void foo() { + CFSomethingSomethingRetain(); // no-crash + CFSomethingSomethingAutorelease(); // no-crash +} + +}