fix PR4010: add support for the warn_unused_result for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/unused-expr.c b/test/Sema/unused-expr.c
index 70f3446..284818d 100644
--- a/test/Sema/unused-expr.c
+++ b/test/Sema/unused-expr.c
@@ -96,3 +96,8 @@
 
 int t7 __attribute__ ((warn_unused_result)); // expected-warning {{warning: 'warn_unused_result' attribute only applies to function types}}
 
+// PR4010
+int (*fn4)(void) __attribute__ ((warn_unused_result));
+void t8() {
+  fn4(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}}
+}