[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / warn-unused-but-set-parameters-cpp.cpp
blobea4d2e0bc6223c0cd9bd296ff5d7bbc932df9fb3
1 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-but-set-parameter -verify %s
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;
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;
19 struct S {
20 int i;
23 // In C++, don't warn for a struct (following gcc).
24 void f3(struct S s) {
25 struct S t;
26 s = t;
29 // Also don't warn for a reference.
30 void f4(int &x) {
31 x = 0;
34 // Make sure this doesn't warn.
35 struct A {
36 int i;
37 A(int j) : i(j) {}