gcc/testsuite/g++.dg/modules/anon-3_a.H
raw| 1 | // PR c++/112580 |
| 2 | // { dg-additional-options "-fmodule-header" } |
| 3 | // { dg-module-cmi {} } |
| 4 | |
| 5 | template <typename _Out> |
| 6 | struct _Formatting_scanner { |
| 7 | union { |
| 8 | int _M_values = 42; |
| 9 | }; |
| 10 | virtual int _M_format_arg() { return _M_values; } |
| 11 | }; |
| 12 | |
| 13 | template <typename _Tp> |
| 14 | auto __do_vformat_to() { |
| 15 | _Formatting_scanner<int> s; |
| 16 | return s; |
| 17 | } |
| 18 | |
| 19 | inline auto vformat() { |
| 20 | return __do_vformat_to<int>(); |
| 21 | } |