diff options
| author | Nuno Lopes <nunoplopes@sapo.pt> | 2009-12-20 23:11:08 +0000 |
|---|---|---|
| committer | Nuno Lopes <nunoplopes@sapo.pt> | 2009-12-20 23:11:08 +0000 |
| commit | 518e37071916d433aea03a8bd33087fd68abd7e5 (patch) | |
| tree | 93637d1fa20056dbf64bb6718878b5bd2b84ddb1 /clang/test/Sema/unused-expr.c | |
| parent | 1576850a7636fd7b4b77ea31762b58fb140ac969 (diff) | |
| download | bcm5719-llvm-518e37071916d433aea03a8bd33087fd68abd7e5.tar.gz bcm5719-llvm-518e37071916d433aea03a8bd33087fd68abd7e5.zip | |
fix PR4010: add support for the warn_unused_result for function pointers
llvm-svn: 91803
Diffstat (limited to 'clang/test/Sema/unused-expr.c')
| -rw-r--r-- | clang/test/Sema/unused-expr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/unused-expr.c b/clang/test/Sema/unused-expr.c index 70f3446e539..284818dc581 100644 --- a/clang/test/Sema/unused-expr.c +++ b/clang/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}} +} |

