Debian Codegraph @

clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-arc.mm

raw
1 // RUN: clang-tidy %s -checks=-*,performance-unnecessary-value-param -- \
2 // RUN: -xobjective-c++ -fobjc-abi-version=2 -fobjc-arc | count 0
3
4 #if !__has_feature(objc_arc)
5 #error Objective-C ARC not enabled as expected
6 #endif
7
8 // Passing an Objective-C ARC-managed object to a C function should
9 // not raise performance-unnecessary-value-param.
10 void foo(id object) { }
11
12 // Same for explicitly non-ARC-managed Objective-C objects.
13 void bar(__unsafe_unretained id object) { }
14
15 // Same for Objective-c classes.
16 void baz(Class c) { }