|
8 | 8 |
|
9 | 9 | #line 1 "pure2-ufcs-member-access-and-chaining.cpp2"
|
10 | 10 |
|
| 11 | +#line 48 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 12 | +class mytype; |
| 13 | + |
11 | 14 |
|
12 | 15 | //=== Cpp2 type definitions and function declarations ===========================
|
13 | 16 |
|
14 | 17 | #line 1 "pure2-ufcs-member-access-and-chaining.cpp2"
|
15 | 18 | [[nodiscard]] auto main() -> int;
|
16 | 19 |
|
17 |
| -#line 26 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 20 | +#line 29 "pure2-ufcs-member-access-and-chaining.cpp2" |
18 | 21 | auto no_return([[maybe_unused]] auto const& unnamed_param_1) -> void;
|
19 | 22 |
|
20 | 23 | [[nodiscard]] auto ufcs(cpp2::impl::in<int> i) -> int;
|
21 | 24 | using fun_ret = int;
|
22 | 25 |
|
23 | 26 |
|
24 |
| -#line 32 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 27 | +#line 35 "pure2-ufcs-member-access-and-chaining.cpp2" |
25 | 28 | [[nodiscard]] auto fun() -> fun_ret;
|
26 | 29 |
|
27 |
| -#line 37 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 30 | +#line 40 "pure2-ufcs-member-access-and-chaining.cpp2" |
28 | 31 | [[nodiscard]] auto get_i(auto const& r) -> int;
|
29 | 32 |
|
30 |
| -#line 41 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 33 | +#line 44 "pure2-ufcs-member-access-and-chaining.cpp2" |
31 | 34 | // And a test for non-local UFCS, which shouldn't do a [&] capture
|
32 | 35 | [[nodiscard]] auto f([[maybe_unused]] auto const& unnamed_param_1) -> int;
|
33 | 36 | extern int y;
|
34 | 37 |
|
| 38 | +class mytype { |
| 39 | + public: static auto hun(cpp2::impl::in<int> i) -> void; |
| 40 | + public: mytype() = default; |
| 41 | + public: mytype(mytype const&) = delete; /* No 'that' constructor, suppress copy */ |
| 42 | + public: auto operator=(mytype const&) -> void = delete; |
| 43 | + |
| 44 | +#line 50 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 45 | +}; |
| 46 | + |
| 47 | + |
35 | 48 | //=== Cpp2 function definitions =================================================
|
36 | 49 |
|
37 | 50 | #line 1 "pure2-ufcs-member-access-and-chaining.cpp2"
|
@@ -59,30 +72,36 @@ extern int y;
|
59 | 72 | CPP2_UFCS(no_return)(42);
|
60 | 73 |
|
61 | 74 | CPP2_UFCS(no_return)(cpp2::move(res));
|
| 75 | + |
| 76 | + mytype obj {}; |
| 77 | + cpp2::move(obj).hun(42);// explicit non-UFCS |
62 | 78 | }
|
63 | 79 |
|
64 |
| -#line 26 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 80 | +#line 29 "pure2-ufcs-member-access-and-chaining.cpp2" |
65 | 81 | auto no_return([[maybe_unused]] auto const& unnamed_param_1) -> void{}
|
66 | 82 |
|
67 |
| -#line 28 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 83 | +#line 31 "pure2-ufcs-member-access-and-chaining.cpp2" |
68 | 84 | [[nodiscard]] auto ufcs(cpp2::impl::in<int> i) -> int{
|
69 | 85 | return i + 2;
|
70 | 86 | }
|
71 | 87 |
|
72 |
| -#line 32 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 88 | +#line 35 "pure2-ufcs-member-access-and-chaining.cpp2" |
73 | 89 | [[nodiscard]] auto fun() -> fun_ret{
|
74 | 90 | cpp2::impl::deferred_init<int> i;
|
75 |
| -#line 33 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 91 | +#line 36 "pure2-ufcs-member-access-and-chaining.cpp2" |
76 | 92 | i.construct(42);
|
77 | 93 | return std::move(i.value());
|
78 | 94 | }
|
79 | 95 |
|
80 |
| -#line 37 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 96 | +#line 40 "pure2-ufcs-member-access-and-chaining.cpp2" |
81 | 97 | [[nodiscard]] auto get_i(auto const& r) -> int{
|
82 | 98 | return r;
|
83 | 99 | }
|
84 | 100 |
|
85 |
| -#line 42 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 101 | +#line 45 "pure2-ufcs-member-access-and-chaining.cpp2" |
86 | 102 | [[nodiscard]] auto f([[maybe_unused]] auto const& unnamed_param_1) -> int { return 0; }
|
87 | 103 | int y {CPP2_UFCS_NONLOCAL(f)(0)};
|
88 | 104 |
|
| 105 | +#line 49 "pure2-ufcs-member-access-and-chaining.cpp2" |
| 106 | + auto mytype::hun(cpp2::impl::in<int> i) -> void{} |
| 107 | + |
0 commit comments