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();
// Inspect the result type.
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}}
+}