|
| 1 | + |
| 2 | +#define CPP2_USE_MODULES Yes |
| 3 | + |
| 4 | +//=== Cpp2 type declarations ==================================================== |
| 5 | + |
| 6 | + |
| 7 | +#include "cpp2util.h" |
| 8 | + |
| 9 | + |
| 10 | +#line 6 "pure2-bugfix-for-ufcs-arguments.cpp2" |
| 11 | +class t; |
| 12 | + |
| 13 | + |
| 14 | +//=== Cpp2 type definitions and function declarations =========================== |
| 15 | + |
| 16 | +#line 1 "pure2-bugfix-for-ufcs-arguments.cpp2" |
| 17 | +[[nodiscard]] auto print_res(cpp2::in<cpp2::i32> x) -> cpp2::i32; |
| 18 | + |
| 19 | + |
| 20 | +#line 6 "pure2-bugfix-for-ufcs-arguments.cpp2" |
| 21 | +class t { |
| 22 | + public: [[nodiscard]] auto f() -> cpp2::i32; |
| 23 | + public: [[nodiscard]] auto f(auto const& x) -> cpp2::i32; |
| 24 | + public: template<typename T> [[nodiscard]] auto f() -> cpp2::i32; |
| 25 | + public: template<typename T> [[nodiscard]] auto f(auto const& x) -> cpp2::i32; |
| 26 | + public: template<typename T, typename U> [[nodiscard]] auto f(auto const& x, auto const& y) -> cpp2::i32; |
| 27 | + |
| 28 | + public: t() = default; |
| 29 | + public: t(t const&) = delete; /* No 'that' constructor, suppress copy */ |
| 30 | + public: auto operator=(t const&) -> void = delete; |
| 31 | +#line 12 "pure2-bugfix-for-ufcs-arguments.cpp2" |
| 32 | +}; |
| 33 | +[[nodiscard]] auto f(cpp2::in<t> o) -> cpp2::i32; |
| 34 | +[[nodiscard]] auto f(cpp2::in<t> o, auto const& x) -> cpp2::i32; |
| 35 | +template<typename T> [[nodiscard]] auto f(cpp2::in<t> o) -> cpp2::i32; |
| 36 | +template<typename T> [[nodiscard]] auto f(cpp2::in<t> o, auto const& x) -> cpp2::i32; |
| 37 | +template<typename T, typename U> [[nodiscard]] auto f(cpp2::in<t> o, auto const& x, auto const& y) -> cpp2::i32; |
| 38 | +extern t m; |
| 39 | +extern t const n; |
| 40 | +template<typename T, typename U> auto const& a = n; |
| 41 | +extern cpp2::i32 auto_21_1; |
| 42 | +extern cpp2::i32 auto_22_1; |
| 43 | +extern cpp2::i32 auto_23_1; |
| 44 | +extern cpp2::i32 auto_24_1; |
| 45 | +extern cpp2::i32 auto_25_1; |
| 46 | +extern cpp2::i32 auto_26_1; |
| 47 | +extern cpp2::i32 auto_27_1; |
| 48 | +extern cpp2::i32 auto_28_1; |
| 49 | +extern cpp2::i32 auto_29_1; |
| 50 | +extern cpp2::i32 auto_30_1; |
| 51 | +extern cpp2::i32 auto_31_1; |
| 52 | +auto main() -> int; |
| 53 | + |
| 54 | + |
| 55 | +//=== Cpp2 function definitions ================================================= |
| 56 | + |
| 57 | +#line 1 "pure2-bugfix-for-ufcs-arguments.cpp2" |
| 58 | +[[nodiscard]] auto print_res(cpp2::in<cpp2::i32> x) -> cpp2::i32{ |
| 59 | + std::cout << x; |
| 60 | + if ((x==9)) {std::cout << '\n'; } |
| 61 | + return x; |
| 62 | +} |
| 63 | + |
| 64 | + [[nodiscard]] auto t::f() -> cpp2::i32 { return print_res(0); } |
| 65 | + [[nodiscard]] auto t::f(auto const& x) -> cpp2::i32 { return print_res(1); } |
| 66 | + template<typename T> [[nodiscard]] auto t::f() -> cpp2::i32 { return print_res(2); } |
| 67 | + template<typename T> [[nodiscard]] auto t::f(auto const& x) -> cpp2::i32 { return print_res(3); } |
| 68 | + template<typename T, typename U> [[nodiscard]] auto t::f(auto const& x, auto const& y) -> cpp2::i32 { return print_res(4); } |
| 69 | + |
| 70 | +[[nodiscard]] auto f(cpp2::in<t> o) -> cpp2::i32 { return print_res(5); } |
| 71 | +[[nodiscard]] auto f(cpp2::in<t> o, auto const& x) -> cpp2::i32 { return print_res(6); } |
| 72 | +template<typename T> [[nodiscard]] auto f(cpp2::in<t> o) -> cpp2::i32 { return print_res(7); } |
| 73 | +template<typename T> [[nodiscard]] auto f(cpp2::in<t> o, auto const& x) -> cpp2::i32 { return print_res(8); } |
| 74 | +template<typename T, typename U> [[nodiscard]] auto f(cpp2::in<t> o, auto const& x, auto const& y) -> cpp2::i32 { return print_res(9); } |
| 75 | +t m {}; |
| 76 | +t const n {}; |
| 77 | + |
| 78 | +cpp2::i32 auto_21_1 {CPP2_UFCS(,,(f),(m),())}; |
| 79 | +cpp2::i32 auto_22_1 {CPP2_UFCS(,,(f),(m),(,), 0)}; |
| 80 | +cpp2::i32 auto_23_1 {CPP2_UFCS(,template,(f<t>),(m),())}; |
| 81 | +cpp2::i32 auto_24_1 {CPP2_UFCS(,template,(f<t>),(m),(,), 0)}; |
| 82 | +cpp2::i32 auto_25_1 {CPP2_UFCS(,template,(f<t,t>),(m),(,), 0, 0)}; |
| 83 | +cpp2::i32 auto_26_1 {CPP2_UFCS(,,(f),(n),())}; |
| 84 | +cpp2::i32 auto_27_1 {CPP2_UFCS(,,(f),(n),(,), 0)}; |
| 85 | +cpp2::i32 auto_28_1 {CPP2_UFCS(,template,(f<t>),(n),())}; |
| 86 | +cpp2::i32 auto_29_1 {CPP2_UFCS(,template,(f<t>),(n),(,), 0)}; |
| 87 | +cpp2::i32 auto_30_1 {CPP2_UFCS(,template,(f<t,t>),(n),(,), 0, 0)}; |
| 88 | +cpp2::i32 auto_31_1 {CPP2_UFCS(,template,(f<t,t>),(a<t,t>),(,), 0, 0)}; |
| 89 | +auto main() -> int{ |
| 90 | + cpp2::i32 auto_33_3 {CPP2_UFCS(&,,(f),(m),())}; |
| 91 | + cpp2::i32 auto_34_3 {CPP2_UFCS(&,,(f),(m),(,), 0)}; |
| 92 | + cpp2::i32 auto_35_3 {CPP2_UFCS(&,template,(f<t>),(m),())}; |
| 93 | + cpp2::i32 auto_36_3 {CPP2_UFCS(&,template,(f<t>),(m),(,), 0)}; |
| 94 | + cpp2::i32 auto_37_3 {CPP2_UFCS(&,template,(f<t,t>),(m),(,), 0, 0)}; |
| 95 | + cpp2::i32 auto_38_3 {CPP2_UFCS(&,,(f),(n),())}; |
| 96 | + cpp2::i32 auto_39_3 {CPP2_UFCS(&,,(f),(n),(,), 0)}; |
| 97 | + cpp2::i32 auto_40_3 {CPP2_UFCS(&,template,(f<t>),(n),())}; |
| 98 | + cpp2::i32 auto_41_3 {CPP2_UFCS(&,template,(f<t>),(n),(,), 0)}; |
| 99 | + cpp2::i32 auto_42_3 {CPP2_UFCS(&,template,(f<t,t>),(n),(,), 0, 0)}; |
| 100 | + cpp2::i32 auto_43_3 {CPP2_UFCS(&,template,(f<t,t>),(a<t,t>),(,), 0, 0)}; |
| 101 | +} |
| 102 | + |
0 commit comments