Mercurial > hg > CbC > CbC_llvm
comparison clang/test/Sema/warn-unused-but-set-parameters.c @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
1 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-but-set-parameter -verify %s | |
2 | |
3 int f0(int x, | |
4 int y, // expected-warning{{parameter 'y' set but not used}} | |
5 int z __attribute__((unused))) { | |
6 y = 0; | |
7 return x; | |
8 } | |
9 | |
10 void f1(void) { | |
11 (void)^(int x, | |
12 int y, // expected-warning{{parameter 'y' set but not used}} | |
13 int z __attribute__((unused))) { | |
14 y = 0; | |
15 return x; | |
16 }; | |
17 } | |
18 | |
19 struct S { | |
20 int i; | |
21 }; | |
22 | |
23 void f3(struct S s) { // expected-warning{{parameter 's' set but not used}} | |
24 struct S t; | |
25 s = t; | |
26 } |