Skip to content

Commit 28124c7

Browse files
committed
test: regenerate regression tests
1 parent 8d35324 commit 28124c7

File tree

43 files changed

+235
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+235
-221
lines changed

regression-tests/test-results/mixed-bounds-check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
std::set_terminate(std::abort);
2727

2828
std::vector v {1, 2, 3, 4, 5, -999};
29-
CPP2_UFCS_0(pop_back, v);
29+
CPP2_UFCS(pop_back)(v);
3030
std::cout << CPP2_ASSERT_IN_BOUNDS(std::move(v), 5) << "\n";
3131
}
3232

regression-tests/test-results/mixed-bounds-safety-with-assert-2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ auto add_42_to_subrange(auto& rng, cpp2::in<int> start, cpp2::in<int> end) -> vo
4040
auto add_42_to_subrange(auto& rng, cpp2::in<int> start, cpp2::in<int> end) -> void
4141
{
4242
cpp2::Bounds.expects(cpp2::cmp_less_eq(0,start), "");
43-
cpp2::Bounds.expects(cpp2::cmp_less_eq(end,CPP2_UFCS_0(ssize, rng)), "");
43+
cpp2::Bounds.expects(cpp2::cmp_less_eq(end,CPP2_UFCS(ssize)(rng)), "");
4444

4545
auto count {0};
4646
for (

regression-tests/test-results/mixed-bounds-safety-with-assert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ auto print_subrange(auto const& rng, cpp2::in<int> start, cpp2::in<int> end) ->
3838

3939
auto print_subrange(auto const& rng, cpp2::in<int> start, cpp2::in<int> end) -> void{
4040
cpp2::Bounds.expects(cpp2::cmp_less_eq(0,start), "");
41-
cpp2::Bounds.expects(cpp2::cmp_less_eq(end,CPP2_UFCS_0(ssize, rng)), "");
41+
cpp2::Bounds.expects(cpp2::cmp_less_eq(end,CPP2_UFCS(ssize)(rng)), "");
4242

4343
auto count {0};
4444
for (

regression-tests/test-results/mixed-bugfix-for-ufcs-non-local.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "cpp2util.h"
77

8+
#line 1 "mixed-bugfix-for-ufcs-non-local.cpp2"
89

910
#line 9 "mixed-bugfix-for-ufcs-non-local.cpp2"
1011
namespace ns {
@@ -15,6 +16,7 @@ namespace ns {
1516

1617
//=== Cpp2 type definitions and function declarations ===========================
1718

19+
#line 1 "mixed-bugfix-for-ufcs-non-local.cpp2"
1820
namespace ns {
1921

2022
template<bool> struct t { };
@@ -38,7 +40,7 @@ bool inline constexpr v2 = CPP2_UFCS_NONLOCAL(f)(o);
3840

3941
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> auto g() -> void;
4042

41-
auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> param1) -> void;
43+
auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void;
4244

4345
auto g() -> void;
4446

@@ -63,20 +65,20 @@ auto main() -> int;
6365

6466
//=== Cpp2 function definitions =================================================
6567

68+
#line 1 "mixed-bugfix-for-ufcs-non-local.cpp2"
6669

6770
#line 9 "mixed-bugfix-for-ufcs-non-local.cpp2"
6871
namespace ns {
6972

7073
#line 21 "mixed-bugfix-for-ufcs-non-local.cpp2"
7174
template<t<CPP2_UFCS_NONLOCAL(f)(o)> _> auto g() -> void{}// Fails on GCC ([GCC109781][]).
7275

73-
auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> param1) -> void{}// Fails on Clang 12 (lambda in unevaluated context).
76+
auto g([[maybe_unused]] cpp2::in<t<CPP2_UFCS_NONLOCAL(f)(o)>> unnamed_param_1) -> void{}// Fails on Clang 12 (lambda in unevaluated context).
7477

7578
auto g() -> void{
76-
cpp2::Default.expects(CPP2_UFCS(f)(o), "");
77-
#line 25 "mixed-bugfix-for-ufcs-non-local.cpp2"
78-
}
79+
cpp2::Default.expects(CPP2_UFCS_NONLOCAL(f)(o), ""); }
7980

81+
#line 27 "mixed-bugfix-for-ufcs-non-local.cpp2"
8082
[[nodiscard]] auto h() -> t<CPP2_UFCS_NONLOCAL(f)(o)> { return o; }// Fails on Clang 12 (lambda in unevaluated context).
8183

8284
#line 39 "mixed-bugfix-for-ufcs-non-local.cpp2"

regression-tests/test-results/mixed-captures-in-expressions-and-postconditions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void
4747
#line 22 "mixed-captures-in-expressions-and-postconditions.cpp2"
4848
{
4949
cpp2::finally_presuccess cpp2_finally_presuccess;
50-
cpp2::Default.expects(cpp2::cmp_less_eq(0,where) && cpp2::cmp_less_eq(where,CPP2_UFCS_0(ssize, vec)), "");
51-
cpp2_finally_presuccess.add([&, _1 = CPP2_UFCS_0(ssize, vec)]{cpp2::Default.expects(CPP2_UFCS_0(ssize, vec) == _1 + 1, "");} );
50+
cpp2::Default.expects(cpp2::cmp_less_eq(0,where) && cpp2::cmp_less_eq(where,CPP2_UFCS_NONLOCAL(ssize)(vec)), "");
51+
cpp2_finally_presuccess.add([&, _1 = CPP2_UFCS_NONLOCAL(ssize)(vec)]{cpp2::Default.expects(CPP2_UFCS_NONLOCAL(ssize)(vec) == _1 + 1, "");} );
5252
#line 23 "mixed-captures-in-expressions-and-postconditions.cpp2"
53-
static_cast<void>(CPP2_UFCS(insert, vec, CPP2_UFCS_0(begin, vec) + where, val));
53+
static_cast<void>(CPP2_UFCS(insert)(vec, CPP2_UFCS(begin)(vec) + where, val));
5454
}
5555

regression-tests/test-results/mixed-fixed-type-aliases.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ auto test(auto const& x) -> void{
5757
test(std::move(z));
5858

5959
for ( auto const& arg : args )
60-
std::cout << CPP2_UFCS_0(filename, std::filesystem::path(arg)) << "\n";
60+
std::cout << CPP2_UFCS(filename)(std::filesystem::path(arg)) << "\n";
6161

6262
std::cout << cpp2::to_string(mytype<int>::myvalue<int>) + "\n";
6363
}

regression-tests/test-results/mixed-function-expression-with-pointer-capture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
std::string y {"\n"};
3434
std::ranges::for_each(vec, [_0 = (&y)](auto const& x) -> void {
35-
std::cout << CPP2_UFCS_0(c_str, (*cpp2::assert_not_null(_0))) << x << *cpp2::assert_not_null(_0); }
35+
std::cout << CPP2_UFCS(c_str)((*cpp2::assert_not_null(_0))) << x << *cpp2::assert_not_null(_0); }
3636
);
3737

3838
auto callback {[](auto& x) -> void { x += "-ish"; }};

regression-tests/test-results/mixed-initialization-safety-3-contract-violation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ auto fill(
6161
) -> void
6262

6363
{
64-
cpp2::Default.expects(cpp2::cmp_greater_eq(CPP2_UFCS_0(ssize, value),count), "fill: value must contain at least count elements");
64+
cpp2::Default.expects(cpp2::cmp_greater_eq(CPP2_UFCS_NONLOCAL(ssize)(value),count), "fill: value must contain at least count elements");
6565
#line 25 "mixed-initialization-safety-3-contract-violation.cpp2"
66-
x.construct(CPP2_UFCS(substr, value, 0, count));
66+
x.construct(CPP2_UFCS(substr)(value, 0, count));
6767
}
6868

6969
auto print_decorated(auto const& x) -> void { std::cout << ">> [" << x << "]\n"; }

regression-tests/test-results/mixed-initialization-safety-3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ auto fill(
5555
) -> void
5656

5757
{
58-
cpp2::Default.expects(cpp2::cmp_greater_eq(CPP2_UFCS_0(ssize, value),count), "fill: value must contain at least count elements");
58+
cpp2::Default.expects(cpp2::cmp_greater_eq(CPP2_UFCS_NONLOCAL(ssize)(value),count), "fill: value must contain at least count elements");
5959
#line 23 "mixed-initialization-safety-3.cpp2"
60-
x.construct(CPP2_UFCS(substr, value, 0, count));
60+
x.construct(CPP2_UFCS(substr)(value, 0, count));
6161
}
6262

6363
auto print_decorated(auto const& x) -> void { std::cout << ">> [" << x << "]\n"; }

regression-tests/test-results/mixed-lifetime-safety-and-null-contracts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ auto call_my_framework(char const* msg) -> void;
3434

3535
#line 6 "mixed-lifetime-safety-and-null-contracts.cpp2"
3636
[[nodiscard]] auto main() -> int{
37-
CPP2_UFCS(set_handler, cpp2::Null, &call_my_framework);
37+
CPP2_UFCS(set_handler)(cpp2::Null, &call_my_framework);
3838
try_pointer_stuff();
3939
std::cout << "done\n";
4040
}

regression-tests/test-results/mixed-postexpression-with-capture.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void
5858
#line 19 "mixed-postexpression-with-capture.cpp2"
5959
{
6060
cpp2::finally_presuccess cpp2_finally_presuccess;
61-
cpp2::Default.expects(cpp2::cmp_less_eq(0,where) && cpp2::cmp_less_eq(where,CPP2_UFCS_0(ssize, vec)), "");
62-
cpp2_finally_presuccess.add([&, _1 = CPP2_UFCS_0(size, vec)]{cpp2::Default.expects(CPP2_UFCS_0(size, vec) == _1 + 1, "");} );
61+
cpp2::Default.expects(cpp2::cmp_less_eq(0,where) && cpp2::cmp_less_eq(where,CPP2_UFCS_NONLOCAL(ssize)(vec)), "");
62+
cpp2_finally_presuccess.add([&, _1 = CPP2_UFCS_NONLOCAL(size)(vec)]{cpp2::Default.expects(CPP2_UFCS_NONLOCAL(size)(vec) == _1 + 1, "");} );
6363
#line 20 "mixed-postexpression-with-capture.cpp2"
64-
CPP2_UFCS(push_back, vec, val);
64+
CPP2_UFCS(push_back)(vec, val);
6565
}
6666

6767
[[nodiscard]] auto make_string() -> make_string_ret
6868

6969
{
7070
cpp2::finally_presuccess cpp2_finally_presuccess;
7171
std::string ret {"xyzzy"};
72-
cpp2_finally_presuccess.add([&, _1 = CPP2_UFCS_0(length, ret)]{cpp2::Default.expects(CPP2_UFCS_0(length, ret) == _1 + 5, "");} );
72+
cpp2_finally_presuccess.add([&, _1 = CPP2_UFCS_NONLOCAL(length)(ret)]{cpp2::Default.expects(CPP2_UFCS_NONLOCAL(length)(ret) == _1 + 5, "");} );
7373
#line 26 "mixed-postexpression-with-capture.cpp2"
7474
ret += " and ";
7575
cpp2_finally_presuccess.run(); return std::move(ret); }
@@ -81,7 +81,7 @@ cpp2_finally_presuccess.run(); return std::move(ret); }
8181
cpp2::finally_presuccess cpp2_finally_presuccess;
8282
std::string a {"xyzzy"};
8383
std::string b {"plugh"};
84-
cpp2_finally_presuccess.add([&]{cpp2::Default.expects([_0 = CPP2_UFCS_0(length, a), _1 = CPP2_UFCS_0(length, b), _2 = 5]{ return _0==_1 && _1==_2; }(), "");} );
84+
cpp2_finally_presuccess.add([&]{cpp2::Default.expects([_0 = CPP2_UFCS_NONLOCAL(length)(a), _1 = CPP2_UFCS_NONLOCAL(length)(b), _2 = 5]{ return _0==_1 && _1==_2; }(), "");} );
8585
#line 30 "mixed-postexpression-with-capture.cpp2"
8686
cpp2_finally_presuccess.run(); return { std::move(a), std::move(b) };
8787

regression-tests/test-results/mixed-postfix-expression-custom-formatting.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ auto call([[maybe_unused]] auto const& unnamed_param_1, [[maybe_unused]] auto co
2929

3030
[[nodiscard]] auto test(auto const& a) -> std::string{
3131
return call(a,
32-
++*cpp2::assert_not_null(CPP2_UFCS(b, a, a.c)), "hello", /* polite
32+
++*cpp2::assert_not_null(CPP2_UFCS(b)(a, a.c)), "hello", /* polite
3333
greeting
3434
goes here */" there",
35-
CPP2_UFCS(e, a.d, ++CPP2_UFCS_0(g, *cpp2::assert_not_null(a.f)), // because f is foobar
36-
CPP2_UFCS_0(i, a.h),
37-
CPP2_UFCS(j, a, a.k, a.l))
35+
CPP2_UFCS(e)(a.d, ++CPP2_UFCS(g)(*cpp2::assert_not_null(a.f)), // because f is foobar
36+
CPP2_UFCS(i)(a.h),
37+
CPP2_UFCS(j)(a, a.k, a.l))
3838
);
3939
}
4040

regression-tests/test-results/mixed-string-interpolation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct custom_struct_with_no_stringize_customization { } custom;
3232
std::cout << "a = " + cpp2::to_string(a) + ", b = " + cpp2::to_string(b) + "\n";
3333

3434
b = 42;
35-
std::cout << "a^2 + b = " + cpp2::to_string(a * std::move(a) + CPP2_UFCS_0(value, std::move(b))) + "\n";
35+
std::cout << "a^2 + b = " + cpp2::to_string(a * std::move(a) + CPP2_UFCS(value)(std::move(b))) + "\n";
3636

3737
std::string_view sv {"my string_view"};
3838
std::cout << "sv = " + cpp2::to_string(std::move(sv)) + "\n";

regression-tests/test-results/mixed-type-safety-1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ auto print(cpp2::in<std::string> msg, cpp2::in<bool> b) -> void
5757
print( "1 is int? ", cpp2::is<int>(1));
5858

5959
auto c {cpp2_new<Circle>()}; // safe by construction
60-
Shape* s {CPP2_UFCS_0(get, std::move(c))}; // safe by Lifetime
60+
Shape* s {CPP2_UFCS(get)(std::move(c))}; // safe by Lifetime
6161
print("\ns* is Shape? ", cpp2::is<Shape>(*cpp2::assert_not_null(s)));
6262
print( "s* is Circle? ", cpp2::is<Circle>(*cpp2::assert_not_null(s)));
6363
print( "s* is Square? ", cpp2::is<Square>(*cpp2::assert_not_null(std::move(s))));

regression-tests/test-results/mixed-ufcs-multiple-template-arguments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ struct X {
4141
std::cout << substr<4,8>(test_string) << "\n";
4242

4343
X x {std::move(test_string)};
44-
std::cout << CPP2_UFCS_TEMPLATE_0(substr, (<4,8>), std::move(x)) << "\n";
44+
std::cout << CPP2_UFCS_TEMPLATE(substr<4,8>)(std::move(x)) << "\n";
4545
}
4646

regression-tests/test-results/pure2-bounds-safety-span.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ auto print_and_decorate(auto const& thing) -> void;
3535
static_cast<void>(std::move(words));
3636

3737
auto i {0};
38-
for( ; cpp2::cmp_less(i,CPP2_UFCS_0(ssize, s)); ++i ) {
38+
for( ; cpp2::cmp_less(i,CPP2_UFCS(ssize)(s)); ++i ) {
3939
print_and_decorate(CPP2_ASSERT_IN_BOUNDS(s, i));
4040
}
4141
}

regression-tests/test-results/pure2-bugfix-for-ufcs-arguments.cpp

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,35 @@
66

77
#include "cpp2util.h"
88

9+
#line 1 "pure2-bugfix-for-ufcs-arguments.cpp2"
910

1011
#line 7 "pure2-bugfix-for-ufcs-arguments.cpp2"
1112
class t;
1213

1314

1415
//=== Cpp2 type definitions and function declarations ===========================
1516

17+
#line 1 "pure2-bugfix-for-ufcs-arguments.cpp2"
1618
[[nodiscard]] auto print_res(cpp2::in<cpp2::i32> x) -> cpp2::i32;
17-
1819

1920
#line 7 "pure2-bugfix-for-ufcs-arguments.cpp2"
2021
class t {
2122
public: [[nodiscard]] auto f() & -> cpp2::i32;
22-
public: [[nodiscard]] auto f([[maybe_unused]] auto const& param2) & -> cpp2::i32;
23-
public: template<typename _> [[nodiscard]] auto f() & -> cpp2::i32;
24-
public: template<typename _> [[nodiscard]] auto f([[maybe_unused]] auto const& param2) & -> cpp2::i32;
25-
public: template<typename _, typename U> [[nodiscard]] auto f([[maybe_unused]] auto const& param2, [[maybe_unused]] auto const& param3) & -> cpp2::i32;
23+
public: [[nodiscard]] auto f([[maybe_unused]] auto const& unnamed_param_2) & -> cpp2::i32;
24+
public: template<typename UnnamedTypeParam1> [[nodiscard]] auto f() & -> cpp2::i32;
25+
public: template<typename UnnamedTypeParam1> [[nodiscard]] auto f([[maybe_unused]] auto const& unnamed_param_2) & -> cpp2::i32;
26+
public: template<typename UnnamedTypeParam1, typename U> [[nodiscard]] auto f([[maybe_unused]] auto const& unnamed_param_2, [[maybe_unused]] auto const& unnamed_param_3) & -> cpp2::i32;
2627
};
2728

28-
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1) -> cpp2::i32;
29-
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1, [[maybe_unused]] auto const& param2) -> cpp2::i32;
30-
template<typename _> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1) -> cpp2::i32;
31-
template<typename _> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1, [[maybe_unused]] auto const& param2) -> cpp2::i32;
32-
template<typename _, typename U> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1, [[maybe_unused]] auto const& param2, [[maybe_unused]] auto const& param3) -> cpp2::i32;
29+
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1) -> cpp2::i32;
30+
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1, [[maybe_unused]] auto const& unnamed_param_2) -> cpp2::i32;
31+
template<typename UnnamedTypeParam1> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1) -> cpp2::i32;
32+
template<typename UnnamedTypeParam1> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1, [[maybe_unused]] auto const& unnamed_param_2) -> cpp2::i32;
33+
template<typename UnnamedTypeParam1, typename U> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1, [[maybe_unused]] auto const& unnamed_param_2, [[maybe_unused]] auto const& unnamed_param_3) -> cpp2::i32;
3334

3435
extern t m;
3536
extern t const n;
36-
template<typename _, typename U> auto inline constexpr a = n;
37+
template<typename UnnamedTypeParam1, typename U> auto inline constexpr a = n;
3738

3839
extern cpp2::i32 auto_25_1;
3940
extern cpp2::i32 auto_26_1;
@@ -48,29 +49,30 @@ extern cpp2::i32 auto_34_1;
4849
extern cpp2::i32 auto_35_1;
4950

5051
auto main() -> int;
51-
5252

5353
//=== Cpp2 function definitions =================================================
5454

55+
#line 1 "pure2-bugfix-for-ufcs-arguments.cpp2"
5556
[[nodiscard]] auto print_res(cpp2::in<cpp2::i32> x) -> cpp2::i32{
57+
#line 2 "pure2-bugfix-for-ufcs-arguments.cpp2"
5658
std::cout << x;
5759
if (x == 9) {std::cout << '\n'; }
5860
return x;
5961
}
6062

6163
#line 8 "pure2-bugfix-for-ufcs-arguments.cpp2"
6264
[[nodiscard]] auto t::f() & -> cpp2::i32 { return print_res(0); }
63-
[[nodiscard]] auto t::f([[maybe_unused]] auto const& param2) & -> cpp2::i32 { return print_res(1); }
64-
template<typename _> [[nodiscard]] auto t::f() & -> cpp2::i32 { return print_res(2); }
65-
template<typename _> [[nodiscard]] auto t::f([[maybe_unused]] auto const& param2) & -> cpp2::i32 { return print_res(3); }
66-
template<typename _, typename U> [[nodiscard]] auto t::f([[maybe_unused]] auto const& param2, [[maybe_unused]] auto const& param3) & -> cpp2::i32 { return print_res(4); }
65+
[[nodiscard]] auto t::f([[maybe_unused]] auto const& unnamed_param_2) & -> cpp2::i32 { return print_res(1); }
66+
template<typename UnnamedTypeParam1> [[nodiscard]] auto t::f() & -> cpp2::i32 { return print_res(2); }
67+
template<typename UnnamedTypeParam1> [[nodiscard]] auto t::f([[maybe_unused]] auto const& unnamed_param_2) & -> cpp2::i32 { return print_res(3); }
68+
template<typename UnnamedTypeParam1, typename U> [[nodiscard]] auto t::f([[maybe_unused]] auto const& unnamed_param_2, [[maybe_unused]] auto const& unnamed_param_3) & -> cpp2::i32 { return print_res(4); }
6769

6870
#line 15 "pure2-bugfix-for-ufcs-arguments.cpp2"
69-
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1) -> cpp2::i32 { return print_res(5); }
70-
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1, [[maybe_unused]] auto const& param2) -> cpp2::i32 { return print_res(6); }
71-
template<typename _> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1) -> cpp2::i32 { return print_res(7); }
72-
template<typename _> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1, [[maybe_unused]] auto const& param2) -> cpp2::i32 { return print_res(8); }
73-
template<typename _, typename U> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> param1, [[maybe_unused]] auto const& param2, [[maybe_unused]] auto const& param3) -> cpp2::i32 { return print_res(9); }
71+
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1) -> cpp2::i32 { return print_res(5); }
72+
[[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1, [[maybe_unused]] auto const& unnamed_param_2) -> cpp2::i32 { return print_res(6); }
73+
template<typename UnnamedTypeParam1> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1) -> cpp2::i32 { return print_res(7); }
74+
template<typename UnnamedTypeParam1> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1, [[maybe_unused]] auto const& unnamed_param_2) -> cpp2::i32 { return print_res(8); }
75+
template<typename UnnamedTypeParam1, typename U> [[nodiscard]] auto f([[maybe_unused]] cpp2::in<t> unnamed_param_1, [[maybe_unused]] auto const& unnamed_param_2, [[maybe_unused]] auto const& unnamed_param_3) -> cpp2::i32 { return print_res(9); }
7476

7577
t m {};
7678
t const n {};

regression-tests/test-results/pure2-bugfix-for-ufcs-name-lookup.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
#include "cpp2util.h"
88

9+
#line 1 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
910
class identity;
11+
#line 2 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
1012

1113

1214
#line 5 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
@@ -23,7 +25,9 @@ namespace ns {
2325

2426
//=== Cpp2 type definitions and function declarations ===========================
2527

28+
#line 1 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
2629
class identity {
30+
#line 2 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
2731
public: [[nodiscard]] constexpr auto operator()(auto&& x) const& -> auto&&;
2832
};
2933

@@ -34,7 +38,7 @@ class t {
3438
class u {};
3539

3640
namespace ns {
37-
[[nodiscard]] constexpr auto f([[maybe_unused]] auto const& param1) -> int;
41+
[[nodiscard]] constexpr auto f([[maybe_unused]] auto const& unnamed_param_1) -> int;
3842
} // namespace ns
3943

4044
// v: @struct type = {
@@ -43,10 +47,10 @@ namespace ns {
4347
// }
4448

4549
auto main() -> int;
46-
4750

4851
//=== Cpp2 function definitions =================================================
4952

53+
#line 1 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
5054

5155
#line 2 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
5256
[[nodiscard]] constexpr auto identity::operator()(auto&& x) const& -> auto&& { return CPP2_FORWARD(x); }
@@ -56,7 +60,7 @@ auto main() -> int;
5660

5761
#line 11 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
5862
namespace ns {
59-
[[nodiscard]] constexpr auto f([[maybe_unused]] auto const& param1) -> int { return 1; }
63+
[[nodiscard]] constexpr auto f([[maybe_unused]] auto const& unnamed_param_1) -> int { return 1; }
6064
}
6165

6266
#line 20 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
@@ -129,8 +133,8 @@ cpp2::in<identity> f = identity();
129133
{
130134
auto f {[]() -> void{
131135
static_assert(t().f() == 0);
132-
auto g {[]<typename T>([[maybe_unused]] T const& param1) -> std::void_t<decltype(T().f())>{}};
133-
static_assert(!(std::is_invocable_v<decltype(g),u>));
136+
auto g {[]<typename T>([[maybe_unused]] T const& unnamed_param_1) -> std::void_t<decltype(T().f())>{}};
137+
static_assert(!(std::is_invocable_v<decltype(std::move(g)),u>));
134138
using ns::f;
135139
}};
136140
static_cast<void>(std::move(f));
@@ -153,13 +157,13 @@ cpp2::in<identity> f = identity();
153157
auto f {[]() -> void{
154158
static_cast<void>([]() -> void{
155159
static_assert(t().f() == 0);
156-
auto g {[]<typename T>([[maybe_unused]] T const& param1) -> std::void_t<decltype(T().f())>{}};
157-
static_assert(!(std::is_invocable_v<decltype(g),u>));
160+
auto g {[]<typename T>([[maybe_unused]] T const& unnamed_param_1) -> std::void_t<decltype(T().f())>{}};
161+
static_assert(!(std::is_invocable_v<decltype(std::move(g)),u>));
158162
});
159163
{
160164
static_assert(t().f() == 0);
161-
auto g {[]<typename T>([[maybe_unused]] T const& param1) -> std::void_t<decltype(T().f())>{}};
162-
static_assert(!(std::is_invocable_v<decltype(g),u>));
165+
auto g {[]<typename T>([[maybe_unused]] T const& unnamed_param_1) -> std::void_t<decltype(T().f())>{}};
166+
static_assert(!(std::is_invocable_v<decltype(std::move(g)),u>));
163167
}
164168
using ns::f;
165169
}};

0 commit comments

Comments
 (0)