source: tests/nowarn/unused.cfa@ 5db580e

Last change on this file since 5db580e was 0bf03ba2, checked in by Michael Brooks <mlbrooks@…>, 12 months ago

Remove warnings due to unused parameters in generated code for zero-length ttype instantiations.

  • Property mode set to 100644
File size: 666 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// generated type_name function only needs its parameter as a tag
17enum () foo_t { foo };
18
19// on empty tuple, __cleanup_dtor takes zero actions on its param and
20// _thunk's purpose is to ignore its param
21forall( Args... | { void foo( Args ); } )
22void wrap( Args ) {}
23void foo() {}
24void callWrap() {
25 wrap();
26}
27
28
29int main() {
30 printf( "done\n" );
31}
Note: See TracBrowser for help on using the repository browser.