summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-1.mm
blob: a4ba25943ca968b340373080381c8900c5c9f714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Test __attribute__((unused)) for an Objective-C method parameter.  */
/* { dg-do compile } */
/* { dg-options "-Wunused-parameter" } */

#include <objc/objc.h>

@interface MyRootClass
{
  Class isa;
}
- (id) method1: (id) argument1;
- (id) method2: (id) __attribute__((unused)) argument1;
- (id) method3: (id) __attribute__((unused)) argument1
   andArgument: (id) argument2;
- (id) method4: (id) __attribute__((unused)) argument1
   andArgument: (id) __attribute__((unused)) argument2;
- (id) method5: (id) argument1
   andArgument: (id) __attribute__ ((unused)) argument2;
@end

@implementation MyRootClass
- (id) method1: (id) argument1  /* { dg-warning "unused parameter .argument1." } */
{
  return nil;
}
- (id) method2: (id) __attribute__((unused)) argument1
{
  return nil;
}
- (id) method3: (id) __attribute__((unused)) argument1
   andArgument: (id) argument2 /* { dg-warning "unused parameter .argument2." } */
{
  return nil;
}
- (id) method4: (id) __attribute__((unused)) argument1
   andArgument: (id) __attribute__((unused)) argument2
{
  return nil;
}
- (id) method5: (id) argument1
   andArgument: (id) __attribute__ ((unused)) argument2 /* { dg-warning "unused parameter .argument1." } */
{
  return nil;
}
@end