[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Sema / warn-unused-parameters.c
blob4cc002fbc53753e2aa0d2c40c6cc16821942a66d
1 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-parameter %s 2>&1 | FileCheck %s
2 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused %s 2>&1 | FileCheck -check-prefix=CHECK-unused %s
4 int f0(int x,
5 int y,
6 int z __attribute__((unused))) {
7 return x;
10 void f1(void) {
11 (void)^(int x,
12 int y,
13 int z __attribute__((unused))) { return x; };
16 // Used when testing '-Wunused' to see that we only emit one diagnostic, and no
17 // warnings for the above cases.
18 static void achor(void) {};
20 // Do not warn on naked functions.
21 __attribute__((naked)) static void nakedFunction(int a, int b) { }
23 // CHECK: 5:12: warning: unused parameter 'y'
24 // CHECK: 12:15: warning: unused parameter 'y'
25 // CHECK-unused: 2 warnings generated
27 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything %s 2>&1 | FileCheck -check-prefix=CHECK-everything %s
28 // RUN: not %clang_cc1 -fblocks -fsyntax-only -Weverything -Werror %s 2>&1 | FileCheck -check-prefix=CHECK-everything-error %s
29 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Wno-unused %s 2>&1 | FileCheck -check-prefix=CHECK-everything-no-unused %s
30 // CHECK-everything: 7 warnings generated
31 // CHECK-everything-error: 5 errors generated
32 // CHECK-everything-no-unused: 5 warnings generated