source: tests/nowarn/unused.cfa @ d96f7c4

Last change on this file since d96f7c4 was d84f2ae, checked in by Michael Brooks <mlbrooks@…>, 13 days ago

Fix transpiler-induced unused parameter on layoutof.

  • Property mode set to 100644
File size: 770 bytes
Line 
1// autogens for zero fields won't touch their parameters
2struct Unit {};
3
4// a compound literal in an unevaluated context isn't accessed
5struct Thing { int x; };
6void f() {
7    ( typeof( (Thing){} ) * ) 0p;
8}
9
10// layoutof my_array doesn't need alignof N
11forall( [N] )
12struct my_array {
13    float strides[N];
14};
15
16// layoutof curious_size_dep doesn't need sizeof T
17forall(T *)
18struct curious_size_dep {
19    int x;
20};
21
22// generated type_name function only needs its parameter as a tag
23enum () foo_t { foo };
24
25// on empty tuple,  __cleanup_dtor takes zero actions on its param and
26// _thunk's purpose is to ignore its param
27forall( Args... | { void foo( Args ); } )
28void wrap( Args ) {}
29void foo() {}
30void callWrap() {
31    wrap();
32}
33
34
35int main() {
36    printf( "done\n" );
37}
Note: See TracBrowser for help on using the repository browser.