From 518e37071916d433aea03a8bd33087fd68abd7e5 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 20 Dec 2009 23:11:08 +0000 Subject: fix PR4010: add support for the warn_unused_result for function pointers llvm-svn: 91803 --- clang/lib/Sema/SemaStmt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaStmt.cpp') diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index c2a3a3a8ca6..6a68db75eae 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -96,7 +96,7 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S) { if (const CallExpr *CE = dyn_cast(E)) { // If the callee has attribute pure, const, or warn_unused_result, warn with // a more specific message to make it clear what is happening. - if (const FunctionDecl *FD = CE->getDirectCallee()) { + if (const Decl *FD = CE->getCalleeDecl()) { if (FD->getAttr()) { Diag(Loc, diag::warn_unused_call) << R1 << R2 << "warn_unused_result"; return; -- cgit v1.2.3