summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-21 05:15:32 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-21 05:15:32 +0000
commit2fb89539f78cbb567253dbbb2fb1acb61583867c (patch)
tree4523b07277b61f821bedf7df75c6d682e04a9016 /clang/test
parent1979007ca8cd11853d150699a138172eb16cd4e5 (diff)
downloadbcm5719-llvm-2fb89539f78cbb567253dbbb2fb1acb61583867c.tar.gz
bcm5719-llvm-2fb89539f78cbb567253dbbb2fb1acb61583867c.zip
Clang really intends to reject attribute 'warn_unused_result' on Objective-C methods, but
instead it crashes on them. We might extend this attribute to work on methods, but for now fix the crasher. Addresses <rdar://problem/7670939>. llvm-svn: 96723
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/method-warn-unused-attribute.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/method-warn-unused-attribute.m b/clang/test/SemaObjC/method-warn-unused-attribute.m
new file mode 100644
index 00000000000..d9dcf996ecb
--- /dev/null
+++ b/clang/test/SemaObjC/method-warn-unused-attribute.m
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-value -verify %s
+
+@interface INTF
+// Currently this is rejected by both GCC and Clang (and Clang was crashing on it).
+- (id) foo __attribute__((warn_unused_result)); // expected-warning{{warning: 'warn_unused_result' attribute only applies to function types}}
+@end
+
+
OpenPOWER on IntegriCloud