FD = Ctor->getConstructor();
const CallExpr * CE = CallE.get<const CallExpr *>();
- FD = dyn_cast<FunctionDecl>(CE->getCalleeDecl());
+ FD = dyn_cast_or_null<FunctionDecl>(CE->getCalleeDecl());
// If calling using a function pointer, assume the function does not
// have a callback. TODO: We could check the types of the arguments here.
dealocateMemWhenDoneByRef(&St, x);
}
+int mySub(int, int);
+int myAdd(int, int);
+int fPtr(unsigned cond, int x) {
+ return (cond ? mySub : myAdd)(x, x);
+}
+
// ----------------------------------------------------------------------------
// Below are the known false positives.