Skip to content

CI Update tests - make all tests pass #1324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2
Original file line number Diff line number Diff line change
@@ -38,7 +38,8 @@ d: _ == t<o.f()>(); // Fails on Clang 12 (lambda in unevaluated context).

u: @struct type = {
b: bool == o.f();
c: bool == :(forward x: decltype(o.f())) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
Copy link
Contributor Author

@jarzec jarzec Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Explanation] As mentioned in the PR description, the UFCS restored here in 2992560 makes all compilers report errors/crash on this tests.
For this reason I suggest to keep the regular call until the cause is identified and fixed.
4e2242f was purposely added to the PR as it might help with the investigation.

// UFCS used in the decltype in the line below causes all compilers to report error/crash
c: bool == :(forward x: decltype(f(o))) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
g: (s, sz) pre(s.sz() != 0) = { }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
123
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi ho hum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12145505332166550543
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in nam
pure2-last-use.cpp2:348:161: error: no member named 'move_only_function' in namespace 'std'
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
~~~~~^
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_'
../../../include/cpp2util.h:10109:43: note: expanded from macro 'CPP2_REQUIRES_'
#define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
^~~~~~~~~~~
pure2-last-use.cpp2:348:188: error: expected expression
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(1108) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
../../../include/cpp2util.h(1156) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(920) : Bounds safety violation
../../../include/cpp2util.h(965) : Bounds safety violation
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(920) : Contract violation: fill: value must contain at least count elements
../../../include/cpp2util.h(965) : Contract violation: fill: value must contain at least count elements
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sending error to my framework... [dynamic null dereference attempt detected]
from source location: ../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = int *&]
from source location: ../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = int *&]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
123
0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::expected<int, bool>]: Null safety violation: std::expected has an unexpected value
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::expected<int, bool>]: Null safety violation: std::expected has an unexpected value
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional<int>]: Null safety violation: std::optional does not contain a value
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional<int>]: Null safety violation: std::optional does not contain a value
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr<int>]: Null safety violation: std::shared_ptr is empty
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr<int>]: Null safety violation: std::shared_ptr is empty
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr<int>]: Null safety violation: std::unique_ptr is empty
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr<int>]: Null safety violation: std::unique_ptr is empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi ho hum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12145505332166550543
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in nam
pure2-last-use.cpp2:348:161: error: no member named 'move_only_function' in namespace 'std'
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
~~~~~^
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_'
../../../include/cpp2util.h:10109:43: note: expanded from macro 'CPP2_REQUIRES_'
#define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
^~~~~~~~~~~
pure2-last-use.cpp2:348:188: error: expected expression
Original file line number Diff line number Diff line change
@@ -106,29 +106,4 @@ mixed-bugfix-for-ufcs-non-local.cpp2:27:29: error: a lambda expression cannot ap
../../../include/cpp2util.h:10058:66: note: expanded from macro 'CPP2_UFCS_'
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
^
mixed-bugfix-for-ufcs-non-local.cpp2:42:77: error: no matching function for call to object of type 'ns::u::(lambda at mixed-bugfix-for-ufcs-non-local.cpp2:42:77)'
requires (std::is_convertible_v<CPP2_TYPEOF(x), std::add_const_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>&>) { return CPP2_FORWARD(x); }(true) };
^~~~~~~~~~~~~~~~~~~~~
../../../include/cpp2util.h:10096:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../include/cpp2util.h:10058:66: note: expanded from macro 'CPP2_UFCS_'
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
^
mixed-bugfix-for-ufcs-non-local.cpp2:42:77: note: candidate template ignored: couldn't infer template argument 'Obj'
../../../include/cpp2util.h:10096:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
^
../../../include/cpp2util.h:10058:66: note: expanded from macro 'CPP2_UFCS_'
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
^
mixed-bugfix-for-ufcs-non-local.cpp2:42:77: error: lambda expression in an unevaluated operand
requires (std::is_convertible_v<CPP2_TYPEOF(x), std::add_const_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>&>) { return CPP2_FORWARD(x); }(true) };
^
../../../include/cpp2util.h:10096:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
^
../../../include/cpp2util.h:10058:66: note: expanded from macro 'CPP2_UFCS_'
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
^
14 errors generated.
12 errors generated.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mixed-function-expression-with-pointer-capture.cpp2:13:18: error: no member named 'for_each' in namespace 'std::ranges'
std::ranges::for_each(vec, [_0 = (&y)](auto const& x) mutable -> void {
std::ranges::for_each(vec, [_0 = (&y)](auto const& x) mutable -> decltype(auto) {
~~~~~~~~~~~~~^
mixed-function-expression-with-pointer-capture.cpp2:18:18: error: no member named 'for_each' in namespace 'std::ranges'
std::ranges::for_each(vec, cpp2::move(callback));
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
123
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi ho hum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12145505332166550543
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in nam
pure2-last-use.cpp2:348:161: error: no member named 'move_only_function' in namespace 'std'
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
~~~~~^
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_'
../../../include/cpp2util.h:10109:43: note: expanded from macro 'CPP2_REQUIRES_'
#define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
^~~~~~~~~~~
pure2-last-use.cpp2:348:188: error: expected expression
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(1108) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
../../../include/cpp2util.h(1156) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(920) : Bounds safety violation
../../../include/cpp2util.h(965) : Bounds safety violation
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(920) : Contract violation: fill: value must contain at least count elements
../../../include/cpp2util.h(965) : Contract violation: fill: value must contain at least count elements
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sending error to my framework... [dynamic null dereference attempt detected]
from source location: ../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = int *&]
from source location: ../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = int *&]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
123
0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional<int>]: Null safety violation: std::optional does not contain a value
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional<int>]: Null safety violation: std::optional does not contain a value
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr<int>]: Null safety violation: std::shared_ptr is empty
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr<int>]: Null safety violation: std::shared_ptr is empty
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr<int>]: Null safety violation: std::unique_ptr is empty
../../../include/cpp2util.h(1047) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr<int>]: Null safety violation: std::unique_ptr is empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi ho hum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6443762454025613088
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in nam
pure2-last-use.cpp2:348:161: error: no member named 'move_only_function' in namespace 'std'
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
~~~~~^
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_'
../../../include/cpp2util.h:10109:43: note: expanded from macro 'CPP2_REQUIRES_'
#define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
^~~~~~~~~~~
pure2-last-use.cpp2:348:188: error: expected expression
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
123
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi ho hum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6443762454025613088
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in nam
pure2-last-use.cpp2:348:161: error: no member named 'move_only_function' in namespace 'std'
348 | CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
| ~~~~~^
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_'
10008 | #define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
../../../include/cpp2util.h:10109:43: note: expanded from macro 'CPP2_REQUIRES_'
10109 | #define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
| ^~~~~~~~~~~
pure2-last-use.cpp2:348:188: error: expected expression
348 | CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
123
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi ho hum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12145505332166550543
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in nam
pure2-last-use.cpp2:348:161: error: no member named 'move_only_function' in namespace 'std'
348 | CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
| ~~~~~^
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_'
10008 | #define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
../../../include/cpp2util.h:10109:43: note: expanded from macro 'CPP2_REQUIRES_'
10109 | #define CPP2_REQUIRES_(...) requires (__VA_ARGS__)
| ^~~~~~~~~~~
pure2-last-use.cpp2:348:188: error: expected expression
348 | CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:115&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:115 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation
mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:129&, cpp2::impl::in<int>, cpp2::impl::in<int>) [with auto:129 = std::vector<int>; cpp2::impl::in<int> = const int]: Bounds safety violation
Loading