Skip to content

Commit 76641b2

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 7a1a992 commit 76641b2

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

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

666673
#if defined(__clang_major__)
667674
// Also check __cplusplus, only to satisfy Clang -pedantic-errors
@@ -687,84 +694,26 @@ class out {
687694
#endif
688695

689696

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

760-
#define CPP2_UFCS_TEMPLATE_0_NONLOCAL(FUNCNAME,TEMPARGS,PARAM1) \
761-
[] CPP2_LAMBDA_NO_DISCARD (auto&& obj) CPP2_FORCE_INLINE_LAMBDA -> decltype(auto) { \
762-
if constexpr (requires{ CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); }) { \
763-
return CPP2_FORWARD(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); \
764-
} else { \
765-
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (CPP2_FORWARD(obj)); \
766-
} \
767-
}(PARAM1)
713+
#define CPP2_UFCS(...) CPP2_UFCS_(&,,__VA_ARGS__)
714+
#define CPP2_UFCS_TEMPLATE(...) CPP2_UFCS_(&,template,__VA_ARGS__)
715+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,,__VA_ARGS__)
716+
#define CPP2_UFCS_TEMPLATE_NONLOCAL(...) CPP2_UFCS_(,template,__VA_ARGS__)
768717

769718

770719
//-----------------------------------------------------------------------
@@ -833,17 +782,17 @@ auto is( X const& ) -> bool {
833782

834783
template< typename C, typename X >
835784
requires (
836-
( std::is_base_of_v<X, C> ||
837-
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
785+
( std::is_base_of_v<X, C> ||
786+
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
838787
) && !std::is_same_v<C,X>)
839788
auto is( X const& x ) -> bool {
840789
return Dynamic_cast<C const*>(&x) != nullptr;
841790
}
842791

843792
template< typename C, typename X >
844793
requires (
845-
( std::is_base_of_v<X, C> ||
846-
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
794+
( std::is_base_of_v<X, C> ||
795+
( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
847796
) && !std::is_same_v<C,X>)
848797
auto is( X const* x ) -> bool {
849798
return Dynamic_cast<C const*>(x) != nullptr;
@@ -1431,7 +1380,7 @@ inline auto to_string(std::string const& s) -> std::string const&
14311380

14321381
template<typename T>
14331382
inline auto to_string(T const& sv) -> std::string
1434-
requires (std::is_convertible_v<T, std::string_view>
1383+
requires (std::is_convertible_v<T, std::string_view>
14351384
&& !std::is_convertible_v<T, const char*>)
14361385
{
14371386
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)