summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-value-param-arc.m
blob: f315e6883088462ceb0338029cf93e4d962ce50b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: clang-tidy %s -checks=-*,performance-unnecessary-value-param -- \
// RUN:   -xobjective-c -fobjc-abi-version=2 -fobjc-arc | count 0

#if !__has_feature(objc_arc)
#error Objective-C ARC not enabled as expected
#endif

// Passing an Objective-C ARC-managed object to a C function should
// not raise performance-unnecessary-value-param.
void foo(id object) { }

// Same for explicitly non-ARC-managed Objective-C objects.
void bar(__unsafe_unretained id object) { }

// Same for Objective-c classes.
void baz(Class c) { }
OpenPOWER on IntegriCloud