gcc/testsuite/g++.dg/modules/contracts-tpl-friend-1_b.C
raw| 1 | // { dg-additional-options "-fmodules-ts -fcontracts" } |
| 2 | |
| 3 | module foo; |
| 4 | |
| 5 | void foo (int x, void *p) |
| 6 | [[ pre: x > 0 ]] |
| 7 | { |
| 8 | auto *obj = reinterpret_cast<TPL<int> *> (p); |
| 9 | |
| 10 | obj->member = x; |
| 11 | } |
| 12 | |
| 13 | void foo (float x, void *p) |
| 14 | [[ pre: x > 0 ]] |
| 15 | { |
| 16 | auto *obj = reinterpret_cast<TPL<float> *> (p); |
| 17 | |
| 18 | obj->member = x; |
| 19 | } |