Skip to content

Commit d167f2b

Browse files
committed
test: add case for the happy path
1 parent 5302db0 commit d167f2b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

regression-tests/pure2-bugfix-for-ufcs-name-lookup.cpp2

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ f: (_) -> int == 1;
1818
// }
1919

2020
main: () = {
21+
{
22+
f: int = t().f();
23+
assert(f == 0);
24+
}
2125
{
2226
f := t().f();
2327
assert(f == 0);

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

+10-6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ namespace ns {
6565

6666
#line 20 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
6767
auto main() -> int{
68+
{
69+
int f {CPP2_UFCS(f)(t())};
70+
cpp2::Default.expects(std::move(f) == 0, "");
71+
}
6872
{
6973
auto f {t().f()};
7074
cpp2::Default.expects(std::move(f) == 0, "");
@@ -75,15 +79,15 @@ auto main() -> int{
7579
}
7680
{
7781
auto const& f = t().f();
78-
#line 29 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
82+
#line 33 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
7983
cpp2::Default.expects(f == 0, "");
8084
}
8185
{
8286
auto const& f = t().f();
83-
#line 30 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
87+
#line 34 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
8488
cpp2::Default.expects(f == 0, "");
8589
}
86-
#line 31 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
90+
#line 35 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
8791
{
8892
auto constexpr f = t().f();
8993
static_assert(f == 0);
@@ -110,15 +114,15 @@ auto const& f = t().f();
110114
auto f {[]() -> void{
111115
{
112116
cpp2::in<identity> f = identity();
113-
#line 55 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
117+
#line 59 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
114118
cpp2::Default.expects(CPP2_UFCS(f)(t()) == 0, "");
115119
}
116120
{
117121
cpp2::in<identity> f = identity();
118-
#line 56 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
122+
#line 60 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
119123
static_cast<void>(CPP2_UFCS(f)(u()));
120124
}
121-
#line 57 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
125+
#line 61 "pure2-bugfix-for-ufcs-name-lookup.cpp2"
122126
}};
123127
static_cast<void>(std::move(f));
124128
}

0 commit comments

Comments
 (0)