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 |
---|
2 | struct Unit {}; |
---|
3 | |
---|
4 | // a compound literal in an unevaluated context isn't accessed |
---|
5 | struct Thing { int x; }; |
---|
6 | void f() { |
---|
7 | ( typeof( (Thing){} ) * ) 0p; |
---|
8 | } |
---|
9 | |
---|
10 | // layoutof my_array doesn't need alignof N |
---|
11 | forall( [N] ) |
---|
12 | struct my_array { |
---|
13 | float strides[N]; |
---|
14 | }; |
---|
15 | |
---|
16 | // layoutof curious_size_dep doesn't need sizeof T |
---|
17 | forall(T *) |
---|
18 | struct curious_size_dep { |
---|
19 | int x; |
---|
20 | }; |
---|
21 | |
---|
22 | // generated type_name function only needs its parameter as a tag |
---|
23 | enum () 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 |
---|
27 | forall( Args... | { void foo( Args ); } ) |
---|
28 | void wrap( Args ) {} |
---|
29 | void foo() {} |
---|
30 | void callWrap() { |
---|
31 | wrap(); |
---|
32 | } |
---|
33 | |
---|
34 | |
---|
35 | int main() { |
---|
36 | printf( "done\n" ); |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.