Fix PR 3337 [retain/release checker]: Handle FunctionDecl's declared using typedefs.
llvm-svn: 62331
This commit is contained in:
parent
4b79e47f94
commit
86afde337d
|
@ -737,7 +737,9 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionType* FT = cast<FunctionType>(FD->getType());
|
// [PR 3337] Use 'getDesugaredType' to strip away any typedefs on the
|
||||||
|
// function's type.
|
||||||
|
FunctionType* FT = cast<FunctionType>(FD->getType()->getDesugaredType());
|
||||||
const char* FName = FD->getIdentifier()->getName();
|
const char* FName = FD->getIdentifier()->getName();
|
||||||
|
|
||||||
// Inspect the result type.
|
// Inspect the result type.
|
||||||
|
|
|
@ -237,3 +237,10 @@ void f11() {
|
||||||
CFRelease(s1); // expected-warning{{Incorrect decrement of the reference count}}
|
CFRelease(s1); // expected-warning{{Incorrect decrement of the reference count}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PR 3337: Handle functions declared using typedefs.
|
||||||
|
typedef CFTypeRef CREATEFUN();
|
||||||
|
CREATEFUN MyCreateFun;
|
||||||
|
|
||||||
|
void f12() {
|
||||||
|
CFTypeRef o = MyCreateFun(); // expected-warning {{leak}}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue