Mercurial > hg > CbC > CbC_llvm
annotate clang/test/SemaObjC/method-warn-unused-attribute.m @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children |
rev | line source |
---|---|
150 | 1 // RUN: %clang_cc1 -fsyntax-only -Wunused-value -verify %s |
2 | |
3 @interface INTF | |
4 - (id) foo __attribute__((warn_unused_result)); | |
5 - (void) garf __attribute__((warn_unused_result)); // expected-warning {{attribute 'warn_unused_result' cannot be applied to Objective-C method without return value}} | |
6 - (int) fee __attribute__((warn_unused_result)); | |
7 + (int) c __attribute__((warn_unused_result)); | |
8 @end | |
9 | |
10 void foo(INTF *a) { | |
11 [a garf]; | |
12 [a fee]; // expected-warning {{ignoring return value of function declared with 'warn_unused_result' attribute}} | |
13 [INTF c]; // expected-warning {{ignoring return value of function declared with 'warn_unused_result' attribute}} | |
14 } | |
15 | |
16 |