aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/unused-expr.c
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-12-20 23:11:08 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-12-20 23:11:08 +0000
commitd20254f2875d0004c57ee766f258dbcee29f4841 (patch)
tree6c4ddb716d8e6c7712ad5874c261306c448f09f6 /test/Sema/unused-expr.c
parent6405646cb649e4b4c6768b92d1fc83c175722f62 (diff)
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
Diffstat (limited to 'test/Sema/unused-expr.c')
-rw-r--r--test/Sema/unused-expr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/unused-expr.c b/test/Sema/unused-expr.c
index 70f3446e53..284818dc58 100644
--- a/test/Sema/unused-expr.c
+++ b/test/Sema/unused-expr.c
@@ -96,3 +96,8 @@ int t6() {
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}}
+}