From 263915832993dd12beee10e204f9ebcc6c786ed2 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 30 Dec 2023 23:39:37 +0100 Subject: Meta: initial commit of WestCo optimized toolchain. Signed-off-by: Amlal El Mahrouss --- ...d-function-expression-with-repeated-capture.cpp2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CompilerDriver/cc2/regression-tests/mixed-function-expression-with-repeated-capture.cpp2 (limited to 'CompilerDriver/cc2/regression-tests/mixed-function-expression-with-repeated-capture.cpp2') diff --git a/CompilerDriver/cc2/regression-tests/mixed-function-expression-with-repeated-capture.cpp2 b/CompilerDriver/cc2/regression-tests/mixed-function-expression-with-repeated-capture.cpp2 new file mode 100644 index 0000000..fbc6582 --- /dev/null +++ b/CompilerDriver/cc2/regression-tests/mixed-function-expression-with-repeated-capture.cpp2 @@ -0,0 +1,21 @@ +#include +#include +#include +#include +#include +#include + +main: () -> int = { + vec: std::vector + = ("hello", "2022"); + + y := "\n"; + std::ranges::for_each + ( vec, :(x) = std::cout << y$ << x << y$ ); + + callback := :(inout x) = x += "-ish"; + std::ranges::for_each( vec, callback ); + + for vec do (str) + std::cout << str << "\n"; +} -- cgit v1.2.3