An indirect call has no associated function declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297694
91177308-0d34-0410-b5e6-
96231b3b80d8
// but can be very challenging to debug.
if (auto *Caller = getCurFunctionDecl())
if (Caller->hasAttr<ARMInterruptAttr>())
- if (!FDecl->hasAttr<ARMInterruptAttr>())
+ if (!FDecl || !FDecl->hasAttr<ARMInterruptAttr>())
Diag(Fn->getExprLoc(), diag::warn_arm_interrupt_calling_convention);
// Promote the function operand.
callee1(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}}
callee2();
}
+
+void (*callee3)();
+__attribute__((interrupt("IRQ"))) void caller3() {
+ callee3(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}}
+}