summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
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