Skip to content

Commit c24155b

Browse files
committed
fix(cpp1): handle known UFCS corner cases
Provide transparent SFINAE. Forward `noexcept`. Accept object with unparenthesized comma like `v<a, b>`. Incidentially, merge the UFCS macros.
1 parent bf29741 commit c24155b

File tree

65 files changed

+666
-363
lines changed

Some content is hidden

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

65 files changed

+666
-363
lines changed

include/cpp2util.h

+35-86
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
// in our -pure-cpp2 "import std;" simulation mode... if you need this,
192192
// use mixed mode (not -pure-cpp2) and #include all the headers you need
193193
// including this one
194-
//
194+
//
195195
// #include <execution>
196196
#endif
197197

@@ -465,7 +465,7 @@ template<typename T>
465465
auto Typeid() -> decltype(auto) {
466466
#ifdef CPP2_NO_RTTI
467467
Type.expects(
468-
!"'any' dynamic casting is disabled with -fno-rtti", // more likely to appear on console
468+
!"'any' dynamic casting is disabled with -fno-rtti", // more likely to appear on console
469469
"'any' dynamic casting is disabled with -fno-rtti" // make message available to hooked handlers
470470
);
471471
#else
@@ -655,12 +655,19 @@ class out {
655655
//-----------------------------------------------------------------------
656656
//
657657
#if defined(_MSC_VER) && !defined(__clang_major__)
658-
#define CPP2_FORCE_INLINE __forceinline
659-
#define CPP2_FORCE_INLINE_LAMBDA [[msvc::forceinline]]
658+
#define CPP2_FORCE_INLINE __forceinline
659+
#define CPP2_FORCE_INLINE_LAMBDA [[msvc::forceinline]]
660+
#define CPP2_FORCE_INLINE_LAMBDA_CLANG /* empty */
660661
#define CPP2_LAMBDA_NO_DISCARD
661662
#else
662-
#define CPP2_FORCE_INLINE __attribute__((always_inline))
663-
#define CPP2_FORCE_INLINE_LAMBDA __attribute__((always_inline))
663+
#define CPP2_FORCE_INLINE __attribute__((always_inline))
664+
#if defined(__clang__)
665+
#define CPP2_FORCE_INLINE_LAMBDA /* empty */
666+
#define CPP2_FORCE_INLINE_LAMBDA_CLANG __attribute__((always_inline))
667+
#else
668+
#define CPP2_FORCE_INLINE_LAMBDA __attribute__((always_inline))
669+
#define CPP2_FORCE_INLINE_LAMBDA_CLANG /* empty */
670+
#endif
664671

665672
#if defined(__clang_major__)
666673
// Also check __cplusplus, only to satisfy Clang -pedantic-errors
@@ -681,84 +688,26 @@ class out {
681688
#endif
682689

683690

684-
// Note: [&] is because a nested UFCS might be viewed as trying to capture 'this'
685-
686-
#define CPP2_UFCS(FUNCNAME,PARAM1,...) \
687-
[&] CPP2_LAMBDA_NO_DISCARD (auto&& obj, auto&& ...params) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
688-
if constexpr (requires{ CPP2_FORWARD(obj).FUNCNAME(CPP2_FORWARD(params)...); }) { \
689-
return CPP2_FORWARD(obj).FUNCNAME(CPP2_FORWARD(params)...); \
690-
} else { \
691-
return FUNCNAME(CPP2_FORWARD(obj), CPP2_FORWARD(params)...); \
692-
} \
693-
}(PARAM1, __VA_ARGS__)
694-
695-
#define CPP2_UFCS_0(FUNCNAME,PARAM1) \
696-
[&] CPP2_LAMBDA_NO_DISCARD (auto&& obj) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
697-
if constexpr (requires{ CPP2_FORWARD(obj).FUNCNAME(); }) { \
698-
return CPP2_FORWARD(obj).FUNCNAME(); \
699-
} else { \
700-
return FUNCNAME(CPP2_FORWARD(obj)); \
701-
} \
702-
}(PARAM1)
703-
704-
#define CPP2_UFCS_REMPARENS(...) __VA_ARGS__
705-
706-
#define CPP2_UFCS_TEMPLATE(FUNCNAME,TEMPARGS,PARAM1,...) \
707-
[&] CPP2_LAMBDA_NO_DISCARD (auto&& obj, auto&& ...params) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
708-
if constexpr (requires{ CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(params)...); }) { \
709-
return CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(params)...); \
691+
#define CPP2_UFCS_(LAMBDADEFCAPT,TEMPKW,...) \
692+
[LAMBDADEFCAPT] CPP2_LAMBDA_NO_DISCARD (auto&& obj, auto&& ...params) CPP2_FORCE_INLINE_LAMBDA_CLANG \
693+
noexcept(requires { requires requires { CPP2_FORWARD(obj).TEMPKW __VA_ARGS__(CPP2_FORWARD(params)...); }; \
694+
requires noexcept(CPP2_FORWARD(obj).TEMPKW __VA_ARGS__(CPP2_FORWARD(params)...)); } \
695+
|| requires { requires !requires { CPP2_FORWARD(obj).TEMPKW __VA_ARGS__(CPP2_FORWARD(params)...); }; \
696+
requires noexcept(__VA_ARGS__(CPP2_FORWARD(obj), CPP2_FORWARD(params)...)); }) \
697+
CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) \
698+
requires requires { CPP2_FORWARD(obj).TEMPKW __VA_ARGS__(CPP2_FORWARD(params)...); } \
699+
|| requires { __VA_ARGS__(CPP2_FORWARD(obj), CPP2_FORWARD(params)...); } { \
700+
if constexpr (requires{ CPP2_FORWARD(obj).TEMPKW __VA_ARGS__(CPP2_FORWARD(params)...); }) { \
701+
return CPP2_FORWARD(obj).TEMPKW __VA_ARGS__(CPP2_FORWARD(params)...); \
710702
} else { \
711-
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(obj), CPP2_FORWARD(params)...); \
703+
return __VA_ARGS__(CPP2_FORWARD(obj), CPP2_FORWARD(params)...); \
712704
} \
713-
}(PARAM1, __VA_ARGS__)
714-
715-
#define CPP2_UFCS_TEMPLATE_0(FUNCNAME,TEMPARGS,PARAM1) \
716-
[&] CPP2_LAMBDA_NO_DISCARD (auto&& obj) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
717-
if constexpr (requires{ CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); }) { \
718-
return CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); \
719-
} else { \
720-
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(obj)); \
721-
} \
722-
}(PARAM1)
723-
724-
725-
// But for non-local lambdas [&] is not allowed
726-
727-
#define CPP2_UFCS_NONLOCAL(FUNCNAME,PARAM1,...) \
728-
[] CPP2_LAMBDA_NO_DISCARD (auto&& obj, auto&& ...params) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
729-
if constexpr (requires{ CPP2_FORWARD(obj).FUNCNAME(CPP2_FORWARD(params)...); }) { \
730-
return CPP2_FORWARD(obj).FUNCNAME(CPP2_FORWARD(params)...); \
731-
} else { \
732-
return FUNCNAME(CPP2_FORWARD(obj), CPP2_FORWARD(params)...); \
733-
} \
734-
}(PARAM1, __VA_ARGS__)
735-
736-
#define CPP2_UFCS_0_NONLOCAL(FUNCNAME,PARAM1) \
737-
[] CPP2_LAMBDA_NO_DISCARD (auto&& obj) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
738-
if constexpr (requires{ CPP2_FORWARD(obj).FUNCNAME(); }) { \
739-
return CPP2_FORWARD(obj).FUNCNAME(); \
740-
} else { \
741-
return FUNCNAME(CPP2_FORWARD(obj)); \
742-
} \
743-
}(PARAM1)
744-
745-
#define CPP2_UFCS_TEMPLATE_NONLOCAL(FUNCNAME,TEMPARGS,PARAM1,...) \
746-
[] CPP2_LAMBDA_NO_DISCARD (auto&& obj, auto&& ...params) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
747-
if constexpr (requires{ CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(params)...); }) { \
748-
return CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(params)...); \
749-
} else { \
750-
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(obj), CPP2_FORWARD(params)...); \
751-
} \
752-
}(PARAM1, __VA_ARGS__)
705+
}
753706

754-
#define CPP2_UFCS_TEMPLATE_0_NONLOCAL(FUNCNAME,TEMPARGS,PARAM1) \
755-
[] CPP2_LAMBDA_NO_DISCARD (auto&& obj) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
756-
if constexpr (requires{ CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); }) { \
757-
return CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); \
758-
} else { \
759-
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(obj)); \
760-
} \
761-
}(PARAM1)
707+
#define CPP2_UFCS(...) CPP2_UFCS_(&,,__VA_ARGS__)
708+
#define CPP2_UFCS_TEMPLATE(...) CPP2_UFCS_(&,template,__VA_ARGS__)
709+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,,__VA_ARGS__)
710+
#define CPP2_UFCS_TEMPLATE_NONLOCAL(...) CPP2_UFCS_(,template,__VA_ARGS__)
762711

763712

764713
//-----------------------------------------------------------------------
@@ -827,17 +776,17 @@ auto is( X const& ) -> bool {
827776

828777
template< typename C, typename X >
829778
requires (
830-
( std::is_base_of_v<X, C> ||
831-
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
779+
( std::is_base_of_v<X, C> ||
780+
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
832781
) && !std::is_same_v<C,X>)
833782
auto is( X const& x ) -> bool {
834783
return Dynamic_cast<C const*>(&x) != nullptr;
835784
}
836785

837786
template< typename C, typename X >
838787
requires (
839-
( std::is_base_of_v<X, C> ||
840-
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
788+
( std::is_base_of_v<X, C> ||
789+
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
841790
) && !std::is_same_v<C,X>)
842791
auto is( X const* x ) -> bool {
843792
return Dynamic_cast<C const*>(x) != nullptr;
@@ -1425,7 +1374,7 @@ inline auto to_string(std::string const& s) -> std::string const&
14251374

14261375
template<typename T>
14271376
inline auto to_string(T const& sv) -> std::string
1428-
requires (std::is_convertible_v<T, std::string_view>
1377+
requires (std::is_convertible_v<T, std::string_view>
14291378
&& !std::is_convertible_v<T, const char*>)
14301379
{
14311380
return std::string{sv};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
template<bool> struct t { };
2+
constexpr bool f(const t<true>&) { return true; }
3+
constexpr t<true> o{};
4+
5+
// Variables.
6+
7+
// _: <V: t<o.f()>> bool = (); // Blocked on #389, [GCC109781][].
8+
9+
// _: t<o.f()> = (); // Blocked on Clang 12 (lambda in unevaluated context).
10+
11+
_: bool = o.f();
12+
13+
// Functions.
14+
15+
// g: <V: t<o.f()>> () = { } // Blocked on [GCC109781][].
16+
17+
// g: (x: t<o.f()>) = { } // Blocked on Clang 12 (lambda in unevaluated context).
18+
19+
g: () [[pre: o.f()]] = { }
20+
21+
// h: () -> t<o.f()> = o; // Blocked on Clang 12 (lambda in unevaluated context).
22+
23+
// Aliases.
24+
25+
// a: <V: t<o.f()>> type == bool; // Blocked on [GCC109781][].
26+
27+
// b: <V: t<o.f()>> _ == false; // Blocked on [GCC109781][].
28+
29+
// c: type == t<o.f()>; // Blocked on Clang 12 (lambda in unevaluated context).
30+
31+
// d: _ == t<o.f()>(); // Blocked on Clang 12 (lambda in unevaluated context).
32+
33+
main: () = { }
34+
35+
// [GCC109781]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109781
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
print_res: (x: i32) -> i32 = {
2+
std::cout << x;
3+
if (x == 9) { std::cout << '\n'; }
4+
return x;
5+
}
6+
t: type = {
7+
f: (inout this) -> i32 = print_res(0);
8+
f: (inout this, x) -> i32 = print_res(1);
9+
f: <T> (inout this) -> i32 = print_res(2);
10+
f: <T> (inout this, x) -> i32 = print_res(3);
11+
f: <T, U> (inout this, x, y) -> i32 = print_res(4);
12+
}
13+
f: (o: t) -> i32 = print_res(5);
14+
f: (o: t, x) -> i32 = print_res(6);
15+
f: <T> (o: t) -> i32 = print_res(7);
16+
f: <T> (o: t, x) -> i32 = print_res(8);
17+
f: <T, U> (o: t, x, y) -> i32 = print_res(9);
18+
m: t = ();
19+
n: const t = ();
20+
a: <T, U> _ == n;
21+
_: i32 = m.f();
22+
_: i32 = m.f(0);
23+
_: i32 = m.f<t>();
24+
_: i32 = m.f<t>(0);
25+
_: i32 = m.f<t, t>(0, 0);
26+
_: i32 = n.f();
27+
_: i32 = n.f(0);
28+
_: i32 = n.f<t>();
29+
_: i32 = n.f<t>(0);
30+
_: i32 = n.f<t, t>(0, 0);
31+
_: i32 = a<t, t>.f<t, t>(0, 0);
32+
main: () = {
33+
_: i32 = m.f();
34+
_: i32 = m.f(0);
35+
_: i32 = m.f<t>();
36+
_: i32 = m.f<t>(0);
37+
_: i32 = m.f<t, t>(0, 0);
38+
_: i32 = n.f();
39+
_: i32 = n.f(0);
40+
_: i32 = n.f<t>();
41+
_: i32 = n.f<t>(0);
42+
_: i32 = n.f<t, t>(0, 0);
43+
_: i32 = a<t, t>.f<t, t>(0, 0);
44+
45+
_ = :(a, f) = { _ = a.f(a).f(); };
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
t: type = {
2+
swap: (inout this, that) = { }
3+
}
4+
main: () = {
5+
// static_assert(noexcept(t().swap(t()))); // Blocked on Clang 12 (lambda in unevaluated context).
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// f: <T> () -> std::type_identity_t<decltype(T().a())> = { } // Blocked on Clang 12 (lambda in unevaluated context).
2+
B: type = { }
3+
main: () = {
4+
// static_assert(!std::invocable<decltype(:<T> (x: T) -> std::void_t<decltype(f<T>())> = {}), B>); // Blocked on Clang 12 (lambda in unevaluated context).
5+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
clang version 18.0.0 (https://git.uplinklabs.net/mirrors/llvm-project.git c0abd3814564a568dfc607c216e6407eaa314f46)
1+
clang version 18.0.0 (https://github.com/llvm/llvm-project.git c0abd3814564a568dfc607c216e6407eaa314f46)
22
Target: x86_64-pc-linux-gnu
33
Thread model: posix
44
InstalledDir: /home/johel/root/clang-main/bin

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

Whitespace-only changes.

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

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0123456789
2+
9
3+
0123456789
4+
9

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

Whitespace-only changes.

regression-tests/test-results/clang-18/pure2-bugfix-for-ufcs-noexcept.cpp.execution

Whitespace-only changes.

regression-tests/test-results/clang-18/pure2-bugfix-for-ufcs-noexcept.cpp.output

Whitespace-only changes.

regression-tests/test-results/clang-18/pure2-bugfix-for-ufcs-sfinae.cpp.execution

Whitespace-only changes.

regression-tests/test-results/clang-18/pure2-bugfix-for-ufcs-sfinae.cpp.output

Whitespace-only changes.

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

Whitespace-only changes.

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

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0123456789
2+
9
3+
0123456789
4+
9

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

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-bugfix-for-ufcs-noexcept.cpp.execution

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-bugfix-for-ufcs-noexcept.cpp.output

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-bugfix-for-ufcs-sfinae.cpp.execution

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-bugfix-for-ufcs-sfinae.cpp.output

Whitespace-only changes.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
std::set_terminate(std::abort);
2525

2626
std::vector v {1, 2, 3, 4, 5, -999};
27-
CPP2_UFCS_0(pop_back, v);
27+
CPP2_UFCS(pop_back)(v);
2828
std::cout << cpp2::assert_in_bounds(std::move(v), 5) << "\n";
2929
}
3030

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ auto add_42_to_subrange(auto& rng, cpp2::in<int> start, cpp2::in<int> end) -> vo
3838
auto add_42_to_subrange(auto& rng, cpp2::in<int> start, cpp2::in<int> end) -> void
3939
{
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-bounds-safety-with-assert.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ auto print_subrange(auto const& rng, cpp2::in<int> start, cpp2::in<int> end) ->
3737

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

4242
auto count {0};
4343
for (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
3+
//=== Cpp2 type declarations ====================================================
4+
5+
6+
#include "cpp2util.h"
7+
8+
9+
10+
//=== Cpp2 type definitions and function declarations ===========================
11+
12+
template<bool> struct t { };
13+
constexpr bool f(const t<true>&) { return true; }
14+
constexpr t<true> o{};
15+
16+
// Variables.
17+
18+
// _: <V: t<o.f()>> bool = (); // Blocked on #389, [GCC109781][].
19+
20+
// _: t<o.f()> = (); // Blocked on Clang 12 (lambda in unevaluated context).
21+
22+
#line 11 "mixed-bugfix-for-ufcs-non-local.cpp2"
23+
extern bool auto_11_1;
24+
25+
// Functions.
26+
27+
// g: <V: t<o.f()>> () = { } // Blocked on [GCC109781][].
28+
29+
// g: (x: t<o.f()>) = { } // Blocked on Clang 12 (lambda in unevaluated context).
30+
31+
auto g() -> void;
32+
33+
// h: () -> t<o.f()> = o; // Blocked on Clang 12 (lambda in unevaluated context).
34+
35+
// Aliases.
36+
37+
// a: <V: t<o.f()>> type == bool; // Blocked on [GCC109781][].
38+
39+
// b: <V: t<o.f()>> _ == false; // Blocked on [GCC109781][].
40+
41+
// c: type == t<o.f()>; // Blocked on Clang 12 (lambda in unevaluated context).
42+
43+
// d: _ == t<o.f()>(); // Blocked on Clang 12 (lambda in unevaluated context).
44+
45+
auto main() -> int;
46+
47+
// [GCC109781]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109781
48+
49+
50+
//=== Cpp2 function definitions =================================================
51+
52+
53+
#line 11 "mixed-bugfix-for-ufcs-non-local.cpp2"
54+
bool auto_11_1 {CPP2_UFCS_NONLOCAL(f)(o)};
55+
56+
#line 19 "mixed-bugfix-for-ufcs-non-local.cpp2"
57+
auto g() -> void{
58+
cpp2::Default.expects(CPP2_UFCS(f)(o), "");
59+
#line 19 "mixed-bugfix-for-ufcs-non-local.cpp2"
60+
}
61+
62+
#line 33 "mixed-bugfix-for-ufcs-non-local.cpp2"
63+
auto main() -> int{}
64+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mixed-bugfix-for-ufcs-non-local.cpp2... ok (mixed Cpp1/Cpp2, Cpp2 code passes safety checks)
2+

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void
4545

4646
#line 22 "mixed-captures-in-expressions-and-postconditions.cpp2"
4747
{
48-
cpp2::Default.expects(cpp2::cmp_less_eq(0,where) && cpp2::cmp_less_eq(where,CPP2_UFCS_0(ssize, vec)), "");
49-
auto post_21_5 = cpp2::finally_success([_0 = CPP2_UFCS_0(ssize, vec)]{cpp2::Default.expects(CPP2_UFCS_0(ssize, vec)==_0 + 1, "");} );
48+
cpp2::Default.expects(cpp2::cmp_less_eq(0,where) && cpp2::cmp_less_eq(where,CPP2_UFCS(ssize)(vec)), "");
49+
auto post_21_5 = cpp2::finally_success([_0 = CPP2_UFCS(ssize)(vec)]{cpp2::Default.expects(CPP2_UFCS(ssize)(vec)==_0 + 1, "");} );
5050
#line 23 "mixed-captures-in-expressions-and-postconditions.cpp2"
51-
static_cast<void>(CPP2_UFCS(insert, vec, CPP2_UFCS_0(begin, vec) + where, val));
51+
static_cast<void>(CPP2_UFCS(insert)(vec, CPP2_UFCS(begin)(vec) + where, val));
5252
}
5353

0 commit comments

Comments
 (0)