diff --git a/regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2 b/regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2 index 04334d9a2..fb898ee94 100644 --- a/regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2 +++ b/regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2 @@ -38,7 +38,8 @@ d: _ == t(); // 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). + // 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) = { } } diff --git a/regression-tests/test-results/apple-clang-14-c++2b/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/apple-clang-14-c++2b/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/apple-clang-14-c++2b/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/apple-clang-14-c++2b/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/apple-clang-14-c++2b/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/apple-clang-14-c++2b/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/apple-clang-14-c++2b/pure2-hashable.cpp.execution b/regression-tests/test-results/apple-clang-14-c++2b/pure2-hashable.cpp.execution new file mode 100644 index 000000000..cb627d7a9 --- /dev/null +++ b/regression-tests/test-results/apple-clang-14-c++2b/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +12145505332166550543 \ No newline at end of file diff --git a/regression-tests/test-results/apple-clang-14-c++2b/pure2-last-use.cpp.output b/regression-tests/test-results/apple-clang-14-c++2b/pure2-last-use.cpp.output index 6b03c3909..92af2f074 100644 --- a/regression-tests/test-results/apple-clang-14-c++2b/pure2-last-use.cpp.output +++ b/regression-tests/test-results/apple-clang-14-c++2b/pure2-last-use.cpp.output @@ -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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; ~~~~~^ -../../../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 diff --git a/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-check.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-check.cpp.execution index 91a25ada8..82030b2e6 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-check.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-check.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(1108) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector]: 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]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4] diff --git a/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-safety-with-assert.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-safety-with-assert.cpp.execution index 638ccfecc..f2d99f3cf 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-safety-with-assert.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/mixed-bounds-safety-with-assert.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(920) : Bounds safety violation +../../../include/cpp2util.h(965) : Bounds safety violation diff --git a/regression-tests/test-results/apple-clang-15-c++2b/mixed-initialization-safety-3-contract-violation.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/mixed-initialization-safety-3-contract-violation.cpp.execution index 2e659ac3e..737e679f9 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/mixed-initialization-safety-3-contract-violation.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/mixed-initialization-safety-3-contract-violation.cpp.execution @@ -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 diff --git a/regression-tests/test-results/apple-clang-15-c++2b/mixed-lifetime-safety-and-null-contracts.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/mixed-lifetime-safety-and-null-contracts.cpp.execution index c848bf98a..4b83f34a4 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/mixed-lifetime-safety-and-null-contracts.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/mixed-lifetime-safety-and-null-contracts.cpp.execution @@ -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 *&] diff --git a/regression-tests/test-results/apple-clang-15-c++2b/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/apple-clang-15-c++2b/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-expected-not-null.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-expected-not-null.cpp.execution index 58bf51d65..a8c48f53c 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-expected-not-null.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-expected-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::expected]: 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]: Null safety violation: std::expected has an unexpected value diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-optional-not-null.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-optional-not-null.cpp.execution index 8ed66e3a3..a31e19be3 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-optional-not-null.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-optional-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional]: 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]: Null safety violation: std::optional does not contain a value diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-shared-ptr-not-null.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-shared-ptr-not-null.cpp.execution index 092ef8093..4f27b06a2 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-shared-ptr-not-null.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-shared-ptr-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr]: 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]: Null safety violation: std::shared_ptr is empty diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-unique-ptr-not-null.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-unique-ptr-not-null.cpp.execution index acc10a1c1..93fbbe6f3 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-unique-ptr-not-null.cpp.execution +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-assert-unique-ptr-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr]: 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]: Null safety violation: std::unique_ptr is empty diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-hashable.cpp.execution b/regression-tests/test-results/apple-clang-15-c++2b/pure2-hashable.cpp.execution new file mode 100644 index 000000000..cb627d7a9 --- /dev/null +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +12145505332166550543 \ No newline at end of file diff --git a/regression-tests/test-results/apple-clang-15-c++2b/pure2-last-use.cpp.output b/regression-tests/test-results/apple-clang-15-c++2b/pure2-last-use.cpp.output index 6b03c3909..92af2f074 100644 --- a/regression-tests/test-results/apple-clang-15-c++2b/pure2-last-use.cpp.output +++ b/regression-tests/test-results/apple-clang-15-c++2b/pure2-last-use.cpp.output @@ -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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; ~~~~~^ -../../../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 diff --git a/regression-tests/test-results/clang-12-c++20/mixed-bugfix-for-ufcs-non-local.cpp.output b/regression-tests/test-results/clang-12-c++20/mixed-bugfix-for-ufcs-non-local.cpp.output index 77066e8af..93df8807a 100644 --- a/regression-tests/test-results/clang-12-c++20/mixed-bugfix-for-ufcs-non-local.cpp.output +++ b/regression-tests/test-results/clang-12-c++20/mixed-bugfix-for-ufcs-non-local.cpp.output @@ -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&>) { 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&>) { 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. diff --git a/regression-tests/test-results/clang-15-c++20-libcpp/mixed-function-expression-with-pointer-capture.cpp.output b/regression-tests/test-results/clang-15-c++20-libcpp/mixed-function-expression-with-pointer-capture.cpp.output index e498f2c95..35de1d1de 100644 --- a/regression-tests/test-results/clang-15-c++20-libcpp/mixed-function-expression-with-pointer-capture.cpp.output +++ b/regression-tests/test-results/clang-15-c++20-libcpp/mixed-function-expression-with-pointer-capture.cpp.output @@ -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)); diff --git a/regression-tests/test-results/clang-15-c++20-libcpp/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/clang-15-c++20-libcpp/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/clang-15-c++20-libcpp/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/clang-15-c++20-libcpp/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/clang-15-c++20-libcpp/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/clang-15-c++20-libcpp/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/clang-15-c++20-libcpp/pure2-hashable.cpp.execution b/regression-tests/test-results/clang-15-c++20-libcpp/pure2-hashable.cpp.execution new file mode 100644 index 000000000..cb627d7a9 --- /dev/null +++ b/regression-tests/test-results/clang-15-c++20-libcpp/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +12145505332166550543 \ No newline at end of file diff --git a/regression-tests/test-results/clang-15-c++20-libcpp/pure2-last-use.cpp.output b/regression-tests/test-results/clang-15-c++20-libcpp/pure2-last-use.cpp.output index 6b03c3909..92af2f074 100644 --- a/regression-tests/test-results/clang-15-c++20-libcpp/pure2-last-use.cpp.output +++ b/regression-tests/test-results/clang-15-c++20-libcpp/pure2-last-use.cpp.output @@ -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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; ~~~~~^ -../../../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 diff --git a/regression-tests/test-results/clang-15-c++20/mixed-bounds-check.cpp.execution b/regression-tests/test-results/clang-15-c++20/mixed-bounds-check.cpp.execution index 91a25ada8..82030b2e6 100644 --- a/regression-tests/test-results/clang-15-c++20/mixed-bounds-check.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/mixed-bounds-check.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(1108) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector]: 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]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4] diff --git a/regression-tests/test-results/clang-15-c++20/mixed-bounds-safety-with-assert.cpp.execution b/regression-tests/test-results/clang-15-c++20/mixed-bounds-safety-with-assert.cpp.execution index 638ccfecc..f2d99f3cf 100644 --- a/regression-tests/test-results/clang-15-c++20/mixed-bounds-safety-with-assert.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/mixed-bounds-safety-with-assert.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(920) : Bounds safety violation +../../../include/cpp2util.h(965) : Bounds safety violation diff --git a/regression-tests/test-results/clang-15-c++20/mixed-initialization-safety-3-contract-violation.cpp.execution b/regression-tests/test-results/clang-15-c++20/mixed-initialization-safety-3-contract-violation.cpp.execution index 2e659ac3e..737e679f9 100644 --- a/regression-tests/test-results/clang-15-c++20/mixed-initialization-safety-3-contract-violation.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/mixed-initialization-safety-3-contract-violation.cpp.execution @@ -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 diff --git a/regression-tests/test-results/clang-15-c++20/mixed-lifetime-safety-and-null-contracts.cpp.execution b/regression-tests/test-results/clang-15-c++20/mixed-lifetime-safety-and-null-contracts.cpp.execution index c848bf98a..4b83f34a4 100644 --- a/regression-tests/test-results/clang-15-c++20/mixed-lifetime-safety-and-null-contracts.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/mixed-lifetime-safety-and-null-contracts.cpp.execution @@ -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 *&] diff --git a/regression-tests/test-results/clang-15-c++20/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/clang-15-c++20/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/clang-15-c++20/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/clang-15-c++20/pure2-assert-optional-not-null.cpp.execution b/regression-tests/test-results/clang-15-c++20/pure2-assert-optional-not-null.cpp.execution index 8ed66e3a3..a31e19be3 100644 --- a/regression-tests/test-results/clang-15-c++20/pure2-assert-optional-not-null.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/pure2-assert-optional-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional]: 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]: Null safety violation: std::optional does not contain a value diff --git a/regression-tests/test-results/clang-15-c++20/pure2-assert-shared-ptr-not-null.cpp.execution b/regression-tests/test-results/clang-15-c++20/pure2-assert-shared-ptr-not-null.cpp.execution index 092ef8093..4f27b06a2 100644 --- a/regression-tests/test-results/clang-15-c++20/pure2-assert-shared-ptr-not-null.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/pure2-assert-shared-ptr-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr]: 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]: Null safety violation: std::shared_ptr is empty diff --git a/regression-tests/test-results/clang-15-c++20/pure2-assert-unique-ptr-not-null.cpp.execution b/regression-tests/test-results/clang-15-c++20/pure2-assert-unique-ptr-not-null.cpp.execution index acc10a1c1..93fbbe6f3 100644 --- a/regression-tests/test-results/clang-15-c++20/pure2-assert-unique-ptr-not-null.cpp.execution +++ b/regression-tests/test-results/clang-15-c++20/pure2-assert-unique-ptr-not-null.cpp.execution @@ -1 +1 @@ -../../../include/cpp2util.h(999) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr]: 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]: Null safety violation: std::unique_ptr is empty diff --git a/regression-tests/test-results/clang-15-c++20/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/clang-15-c++20/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/clang-15-c++20/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/clang-15-c++20/pure2-hashable.cpp.execution b/regression-tests/test-results/clang-15-c++20/pure2-hashable.cpp.execution new file mode 100644 index 000000000..a11f9eb59 --- /dev/null +++ b/regression-tests/test-results/clang-15-c++20/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +6443762454025613088 \ No newline at end of file diff --git a/regression-tests/test-results/clang-15-c++20/pure2-last-use.cpp.output b/regression-tests/test-results/clang-15-c++20/pure2-last-use.cpp.output index 6b03c3909..92af2f074 100644 --- a/regression-tests/test-results/clang-15-c++20/pure2-last-use.cpp.output +++ b/regression-tests/test-results/clang-15-c++20/pure2-last-use.cpp.output @@ -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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; ~~~~~^ -../../../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 diff --git a/regression-tests/test-results/clang-18-c++20/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/clang-18-c++20/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/clang-18-c++20/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/clang-18-c++20/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/clang-18-c++20/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/clang-18-c++20/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/clang-18-c++20/pure2-hashable.cpp.execution b/regression-tests/test-results/clang-18-c++20/pure2-hashable.cpp.execution new file mode 100644 index 000000000..a11f9eb59 --- /dev/null +++ b/regression-tests/test-results/clang-18-c++20/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +6443762454025613088 \ No newline at end of file diff --git a/regression-tests/test-results/clang-18-c++20/pure2-last-use.cpp.output b/regression-tests/test-results/clang-18-c++20/pure2-last-use.cpp.output index 4162dcfa1..cba276a2d 100644 --- a/regression-tests/test-results/clang-18-c++20/pure2-last-use.cpp.output +++ b/regression-tests/test-results/clang-18-c++20/pure2-last-use.cpp.output @@ -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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; | ~~~~~^ -../../../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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; diff --git a/regression-tests/test-results/clang-18-c++23-libcpp/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/clang-18-c++23-libcpp/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/clang-18-c++23-libcpp/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/clang-18-c++23-libcpp/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/clang-18-c++23-libcpp/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/clang-18-c++23-libcpp/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/clang-18-c++23-libcpp/pure2-hashable.cpp.execution b/regression-tests/test-results/clang-18-c++23-libcpp/pure2-hashable.cpp.execution new file mode 100644 index 000000000..cb627d7a9 --- /dev/null +++ b/regression-tests/test-results/clang-18-c++23-libcpp/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +12145505332166550543 \ No newline at end of file diff --git a/regression-tests/test-results/clang-18-c++23-libcpp/pure2-last-use.cpp.output b/regression-tests/test-results/clang-18-c++23-libcpp/pure2-last-use.cpp.output index 4162dcfa1..cba276a2d 100644 --- a/regression-tests/test-results/clang-18-c++23-libcpp/pure2-last-use.cpp.output +++ b/regression-tests/test-results/clang-18-c++23-libcpp/pure2-last-use.cpp.output @@ -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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; | ~~~~~^ -../../../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>&> && std::is_convertible_v>&> && std::is_convertible_v>&>) ; diff --git a/regression-tests/test-results/gcc-13-c++2b/mixed-bounds-safety-with-assert.cpp.execution b/regression-tests/test-results/gcc-13-c++2b/mixed-bounds-safety-with-assert.cpp.execution index a5e330156..9c6806d3b 100644 --- a/regression-tests/test-results/gcc-13-c++2b/mixed-bounds-safety-with-assert.cpp.execution +++ b/regression-tests/test-results/gcc-13-c++2b/mixed-bounds-safety-with-assert.cpp.execution @@ -1 +1 @@ -mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:115&, cpp2::impl::in, cpp2::impl::in) [with auto:115 = std::vector; cpp2::impl::in = const int]: Bounds safety violation +mixed-bounds-safety-with-assert.cpp2(11) void print_subrange(const auto:129&, cpp2::impl::in, cpp2::impl::in) [with auto:129 = std::vector; cpp2::impl::in = const int]: Bounds safety violation diff --git a/regression-tests/test-results/gcc-13-c++2b/mixed-bugfix-for-ufcs-non-local.cpp.output b/regression-tests/test-results/gcc-13-c++2b/mixed-bugfix-for-ufcs-non-local.cpp.output index dc9d6f979..d41c45e6a 100644 --- a/regression-tests/test-results/gcc-13-c++2b/mixed-bugfix-for-ufcs-non-local.cpp.output +++ b/regression-tests/test-results/gcc-13-c++2b/mixed-bugfix-for-ufcs-non-local.cpp.output @@ -1,41 +1,21 @@ In file included from mixed-bugfix-for-ufcs-non-local.cpp:6: -../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type - 2100 | // - | ^ -../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ - 2137 | return std::same_as; - | ^ +../../../include/cpp2util.h:10059:1: error: lambda-expression in template parameter type +../../../include/cpp2util.h:10096:59: note: in expansion of macro ‘CPP2_UFCS_’ mixed-bugfix-for-ufcs-non-local.cpp2:13:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ mixed-bugfix-for-ufcs-non-local.cpp2:13:36: error: template argument 1 is invalid -../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type - 2100 | // - | ^ -../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ - 2137 | return std::same_as; - | ^ +../../../include/cpp2util.h:10059:1: error: lambda-expression in template parameter type +../../../include/cpp2util.h:10096:59: note: in expansion of macro ‘CPP2_UFCS_’ mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid -../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type - 2100 | // - | ^ -../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ - 2137 | return std::same_as; - | ^ +../../../include/cpp2util.h:10059:1: error: lambda-expression in template parameter type +../../../include/cpp2util.h:10096:59: note: in expansion of macro ‘CPP2_UFCS_’ mixed-bugfix-for-ufcs-non-local.cpp2:31:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ mixed-bugfix-for-ufcs-non-local.cpp2:31:36: error: template argument 1 is invalid -../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type - 2100 | // - | ^ -../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ - 2137 | return std::same_as; - | ^ +../../../include/cpp2util.h:10059:1: error: lambda-expression in template parameter type +../../../include/cpp2util.h:10096:59: note: in expansion of macro ‘CPP2_UFCS_’ mixed-bugfix-for-ufcs-non-local.cpp2:33:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ mixed-bugfix-for-ufcs-non-local.cpp2:33:36: error: template argument 1 is invalid -../../../include/cpp2util.h:2100:1: error: lambda-expression in template parameter type - 2100 | // - | ^ -../../../include/cpp2util.h:2137:59: note: in expansion of macro ‘CPP2_UFCS_’ - 2137 | return std::same_as; - | ^ +../../../include/cpp2util.h:10059:1: error: lambda-expression in template parameter type +../../../include/cpp2util.h:10096:59: note: in expansion of macro ‘CPP2_UFCS_’ mixed-bugfix-for-ufcs-non-local.cpp2:21:12: note: in expansion of macro ‘CPP2_UFCS_NONLOCAL’ mixed-bugfix-for-ufcs-non-local.cpp2:21:36: error: template argument 1 is invalid diff --git a/regression-tests/test-results/gcc-13-c++2b/mixed-parameter-passing.cpp.execution b/regression-tests/test-results/gcc-13-c++2b/mixed-parameter-passing.cpp.execution new file mode 100644 index 000000000..256f7e186 --- /dev/null +++ b/regression-tests/test-results/gcc-13-c++2b/mixed-parameter-passing.cpp.execution @@ -0,0 +1,2 @@ +123 +0 diff --git a/regression-tests/test-results/gcc-13-c++2b/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/gcc-13-c++2b/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/gcc-13-c++2b/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/gcc-13-c++2b/pure2-hashable.cpp.execution b/regression-tests/test-results/gcc-13-c++2b/pure2-hashable.cpp.execution new file mode 100644 index 000000000..a11f9eb59 --- /dev/null +++ b/regression-tests/test-results/gcc-13-c++2b/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +6443762454025613088 \ No newline at end of file diff --git a/regression-tests/test-results/mixed-bugfix-for-ufcs-non-local.cpp b/regression-tests/test-results/mixed-bugfix-for-ufcs-non-local.cpp index f77e3ddd3..8ca78c7c3 100644 --- a/regression-tests/test-results/mixed-bugfix-for-ufcs-non-local.cpp +++ b/regression-tests/test-results/mixed-bugfix-for-ufcs-non-local.cpp @@ -14,7 +14,7 @@ namespace ns { class u; -#line 45 "mixed-bugfix-for-ufcs-non-local.cpp2" +#line 46 "mixed-bugfix-for-ufcs-non-local.cpp2" } @@ -62,6 +62,7 @@ auto inline constexpr d{ t() };// Fails on Clang 12 (l class u { public: static const bool b; + // UFCS used in the decltype in the line below causes all compilers to report error/crash public: static const bool c; public: static auto g(auto const& s, auto const& sz) -> void; }; @@ -95,16 +96,17 @@ auto g() -> void{ #line 40 "mixed-bugfix-for-ufcs-non-local.cpp2" inline CPP2_CONSTEXPR bool u::b{ CPP2_UFCS_NONLOCAL(f)(o) }; + inline CPP2_CONSTEXPR bool u::c{ [](auto&& x) -> decltype(auto)// Fails on Clang 12 (lambda in unevaluated context). -#line 42 "mixed-bugfix-for-ufcs-non-local.cpp2" - requires (std::is_convertible_v&>) { return CPP2_FORWARD(x); }(true) }; -#line 42 "mixed-bugfix-for-ufcs-non-local.cpp2" +#line 43 "mixed-bugfix-for-ufcs-non-local.cpp2" + requires (std::is_convertible_v&>) { return CPP2_FORWARD(x); }(true) }; +#line 43 "mixed-bugfix-for-ufcs-non-local.cpp2" auto u::g(auto const& s, auto const& sz) -> void{ if (cpp2::cpp2_default.is_active() && !(CPP2_UFCS(sz)(s) != 0) ) { cpp2::cpp2_default.report_violation(""); }} -#line 45 "mixed-bugfix-for-ufcs-non-local.cpp2" +#line 46 "mixed-bugfix-for-ufcs-non-local.cpp2" } -#line 47 "mixed-bugfix-for-ufcs-non-local.cpp2" +#line 48 "mixed-bugfix-for-ufcs-non-local.cpp2" auto main() -> int{} diff --git a/regression-tests/test-results/msvc-2022-c++20/mixed-parameter-passing.cpp.output b/regression-tests/test-results/msvc-2022-c++20/mixed-parameter-passing.cpp.output index 195c5a96b..5ca28db9b 100644 --- a/regression-tests/test-results/msvc-2022-c++20/mixed-parameter-passing.cpp.output +++ b/regression-tests/test-results/msvc-2022-c++20/mixed-parameter-passing.cpp.output @@ -1 +1,8 @@ mixed-parameter-passing.cpp +mixed-parameter-passing.cpp2(44): error C2079: 'container::buf' uses undefined class 'std::array' + with + [ + T=int + ] +mixed-parameter-passing.cpp2(44): note: the template instantiation context (the oldest one first) is +mixed-parameter-passing.cpp2(54): note: see reference to class template instantiation 'container' being compiled diff --git a/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output b/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output index 5e8348010..c9ed4c8f9 100644 --- a/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output +++ b/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output @@ -6,7 +6,7 @@ pure2-assert-expected-not-null.cpp2(7): error C2143: syntax error: missing ';' b pure2-assert-expected-not-null.cpp2(7): error C2143: syntax error: missing ';' before '}' pure2-assert-expected-not-null.cpp2(9): error C2065: 'ex': undeclared identifier pure2-assert-expected-not-null.cpp2(9): error C2672: 'cpp2::impl::assert_not_null': no matching overloaded function found -..\..\..\include\cpp2util.h(999): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&,std::source_location)' +..\..\..\include\cpp2util.h(1047): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&,std::source_location)' pure2-assert-expected-not-null.cpp2(14): error C2039: 'expected': is not a member of 'std' predefined C++ types (compiler internal)(347): note: see declaration of 'std' pure2-assert-expected-not-null.cpp2(14): error C2062: type 'int' unexpected @@ -19,4 +19,4 @@ pure2-assert-expected-not-null.cpp2(14): note: while trying to match the argumen pure2-assert-expected-not-null.cpp2(14): error C2143: syntax error: missing ';' before '}' pure2-assert-expected-not-null.cpp2(15): error C2065: 'ex': undeclared identifier pure2-assert-expected-not-null.cpp2(15): error C2672: 'cpp2::impl::assert_not_null': no matching overloaded function found -..\..\..\include\cpp2util.h(999): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&,std::source_location)' +..\..\..\include\cpp2util.h(1047): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&,std::source_location)' diff --git a/regression-tests/test-results/msvc-2022-c++20/pure2-function-single-expression-body-default-return.cpp.execution b/regression-tests/test-results/msvc-2022-c++20/pure2-function-single-expression-body-default-return.cpp.execution new file mode 100644 index 000000000..30f4cb910 --- /dev/null +++ b/regression-tests/test-results/msvc-2022-c++20/pure2-function-single-expression-body-default-return.cpp.execution @@ -0,0 +1 @@ +hi ho hum \ No newline at end of file diff --git a/regression-tests/test-results/msvc-2022-c++20/pure2-function-single-expression-body-default-return.cpp.output b/regression-tests/test-results/msvc-2022-c++20/pure2-function-single-expression-body-default-return.cpp.output new file mode 100644 index 000000000..05d88cb45 --- /dev/null +++ b/regression-tests/test-results/msvc-2022-c++20/pure2-function-single-expression-body-default-return.cpp.output @@ -0,0 +1 @@ +pure2-function-single-expression-body-default-return.cpp diff --git a/regression-tests/test-results/msvc-2022-c++20/pure2-hashable.cpp.execution b/regression-tests/test-results/msvc-2022-c++20/pure2-hashable.cpp.execution new file mode 100644 index 000000000..cc5315af6 --- /dev/null +++ b/regression-tests/test-results/msvc-2022-c++20/pure2-hashable.cpp.execution @@ -0,0 +1 @@ +13929407477532509065 \ No newline at end of file diff --git a/regression-tests/test-results/msvc-2022-c++20/pure2-hashable.cpp.output b/regression-tests/test-results/msvc-2022-c++20/pure2-hashable.cpp.output new file mode 100644 index 000000000..51f787459 --- /dev/null +++ b/regression-tests/test-results/msvc-2022-c++20/pure2-hashable.cpp.output @@ -0,0 +1 @@ +pure2-hashable.cpp diff --git a/regression-tests/test-results/msvc-2022-c++latest/mixed-bugfix-for-ufcs-non-local.cpp.output b/regression-tests/test-results/msvc-2022-c++latest/mixed-bugfix-for-ufcs-non-local.cpp.output index 56127acb5..f3f5e9025 100644 --- a/regression-tests/test-results/msvc-2022-c++latest/mixed-bugfix-for-ufcs-non-local.cpp.output +++ b/regression-tests/test-results/msvc-2022-c++latest/mixed-bugfix-for-ufcs-non-local.cpp.output @@ -1,10 +1 @@ mixed-bugfix-for-ufcs-non-local.cpp -mixed-bugfix-for-ufcs-non-local.cpp2(42): fatal error C1001: Internal compiler error. -(compiler file 'msc1.cpp', line 1593) - To work around this problem, try simplifying or changing the program near the locations listed above. -If possible please provide a repro here: https://developercommunity.visualstudio.com -Please choose the Technical Support command on the Visual C++ - Help menu, or open the Technical Support help file for more information -INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe' - Please choose the Technical Support command on the Visual C++ - Help menu, or open the Technical Support help file for more information