diff --git a/regression-tests/pure2-bugfix-for-unbraced-function-expression.cpp2 b/regression-tests/pure2-bugfix-for-unbraced-function-expression.cpp2 index e3789105b..6fb1d13a1 100644 --- a/regression-tests/pure2-bugfix-for-unbraced-function-expression.cpp2 +++ b/regression-tests/pure2-bugfix-for-unbraced-function-expression.cpp2 @@ -1,12 +1,12 @@ t: type = { - operator[]: (this, f) = { } + operator[]: (this, _) = { } } main: () -> int = { (x := t()) { x[:() -> _ = 0]; } (x := t()) { x[:() -> _ = 0;]; } - assert(!(:() = 0; is int)); + assert(!(:() 0; is int)); return :i32 = 0; } diff --git a/regression-tests/test-results/clang-12/pure2-bugfix-for-unbraced-function-expression.cpp.execution b/regression-tests/test-results/clang-12/pure2-bugfix-for-unbraced-function-expression.cpp.execution new file mode 100644 index 000000000..e69de29bb diff --git a/regression-tests/test-results/clang-12/pure2-bugfix-for-unbraced-function-expression.cpp.output b/regression-tests/test-results/clang-12/pure2-bugfix-for-unbraced-function-expression.cpp.output new file mode 100644 index 000000000..04047528c --- /dev/null +++ b/regression-tests/test-results/clang-12/pure2-bugfix-for-unbraced-function-expression.cpp.output @@ -0,0 +1,7 @@ +pure2-bugfix-for-unbraced-function-expression.cpp2:2:34: warning: unused parameter 'f' [-Wunused-parameter] + auto t::operator[](auto const& f) const& -> void{} + ^ +pure2-bugfix-for-unbraced-function-expression.cpp2:9:65: warning: expression result unused [-Wunused-value] + cpp2::Default.expects(!((cpp2::is([]() mutable -> void { 0; }))), ""); + ^ +2 warnings generated. diff --git a/regression-tests/test-results/clang-12/pure2-for-loop-range-with-lambda.cpp.execution b/regression-tests/test-results/clang-12/pure2-for-loop-range-with-lambda.cpp.execution new file mode 100644 index 000000000..19b3a90b2 --- /dev/null +++ b/regression-tests/test-results/clang-12/pure2-for-loop-range-with-lambda.cpp.execution @@ -0,0 +1 @@ +12345123451234512345 \ No newline at end of file diff --git a/regression-tests/test-results/clang-12/pure2-for-loop-range-with-lambda.cpp.output b/regression-tests/test-results/clang-12/pure2-for-loop-range-with-lambda.cpp.output new file mode 100644 index 000000000..e69de29bb diff --git a/regression-tests/test-results/gcc-10/pure2-bugfix-for-unbraced-function-expression.cpp.execution b/regression-tests/test-results/gcc-10/pure2-bugfix-for-unbraced-function-expression.cpp.execution new file mode 100644 index 000000000..e69de29bb diff --git a/regression-tests/test-results/gcc-10/pure2-bugfix-for-unbraced-function-expression.cpp.output b/regression-tests/test-results/gcc-10/pure2-bugfix-for-unbraced-function-expression.cpp.output new file mode 100644 index 000000000..d76ed67cc --- /dev/null +++ b/regression-tests/test-results/gcc-10/pure2-bugfix-for-unbraced-function-expression.cpp.output @@ -0,0 +1,6 @@ +pure2-bugfix-for-unbraced-function-expression.cpp2: In instantiation of ‘void t::operator[](const auto:90&) const & [with auto:89 = main()::]’: +pure2-bugfix-for-unbraced-function-expression.cpp2:6:4: required from here +pure2-bugfix-for-unbraced-function-expression.cpp2:2:34: warning: unused parameter ‘f’ [-Wunused-parameter] +pure2-bugfix-for-unbraced-function-expression.cpp2: In instantiation of ‘void t::operator[](const auto:90&) const & [with auto:89 = main()::]’: +pure2-bugfix-for-unbraced-function-expression.cpp2:7:4: required from here +pure2-bugfix-for-unbraced-function-expression.cpp2:2:34: warning: unused parameter ‘f’ [-Wunused-parameter] diff --git a/regression-tests/test-results/gcc-10/pure2-for-loop-range-with-lambda.cpp.execution b/regression-tests/test-results/gcc-10/pure2-for-loop-range-with-lambda.cpp.execution new file mode 100644 index 000000000..19b3a90b2 --- /dev/null +++ b/regression-tests/test-results/gcc-10/pure2-for-loop-range-with-lambda.cpp.execution @@ -0,0 +1 @@ +12345123451234512345 \ No newline at end of file diff --git a/regression-tests/test-results/gcc-10/pure2-for-loop-range-with-lambda.cpp.output b/regression-tests/test-results/gcc-10/pure2-for-loop-range-with-lambda.cpp.output new file mode 100644 index 000000000..e69de29bb diff --git a/regression-tests/test-results/gcc-13/pure2-bugfix-for-unbraced-function-expression.cpp.output b/regression-tests/test-results/gcc-13/pure2-bugfix-for-unbraced-function-expression.cpp.output index e69de29bb..46a499999 100644 --- a/regression-tests/test-results/gcc-13/pure2-bugfix-for-unbraced-function-expression.cpp.output +++ b/regression-tests/test-results/gcc-13/pure2-bugfix-for-unbraced-function-expression.cpp.output @@ -0,0 +1,6 @@ +pure2-bugfix-for-unbraced-function-expression.cpp2: In instantiation of ‘void t::operator[](const auto:100&) const & [with auto:99 = main()::]’: +pure2-bugfix-for-unbraced-function-expression.cpp2:6:4: required from here +pure2-bugfix-for-unbraced-function-expression.cpp2:2:34: warning: unused parameter ‘f’ [-Wunused-parameter] +pure2-bugfix-for-unbraced-function-expression.cpp2: In instantiation of ‘void t::operator[](const auto:100&) const & [with auto:99 = main()::]’: +pure2-bugfix-for-unbraced-function-expression.cpp2:7:4: required from here +pure2-bugfix-for-unbraced-function-expression.cpp2:2:34: warning: unused parameter ‘f’ [-Wunused-parameter] diff --git a/regression-tests/test-results/gcc-13/pure2-for-loop-range-with-lambda.cpp.execution b/regression-tests/test-results/gcc-13/pure2-for-loop-range-with-lambda.cpp.execution new file mode 100644 index 000000000..19b3a90b2 --- /dev/null +++ b/regression-tests/test-results/gcc-13/pure2-for-loop-range-with-lambda.cpp.execution @@ -0,0 +1 @@ +12345123451234512345 \ No newline at end of file diff --git a/regression-tests/test-results/gcc-13/pure2-for-loop-range-with-lambda.cpp.output b/regression-tests/test-results/gcc-13/pure2-for-loop-range-with-lambda.cpp.output new file mode 100644 index 000000000..e69de29bb diff --git a/regression-tests/test-results/msvc-2022/pure2-bugfix-for-unbraced-function-expression.cpp.execution b/regression-tests/test-results/msvc-2022/pure2-bugfix-for-unbraced-function-expression.cpp.execution new file mode 100644 index 000000000..e69de29bb diff --git a/regression-tests/test-results/msvc-2022/pure2-bugfix-for-unbraced-function-expression.cpp.output b/regression-tests/test-results/msvc-2022/pure2-bugfix-for-unbraced-function-expression.cpp.output new file mode 100644 index 000000000..57e058827 --- /dev/null +++ b/regression-tests/test-results/msvc-2022/pure2-bugfix-for-unbraced-function-expression.cpp.output @@ -0,0 +1 @@ +pure2-bugfix-for-unbraced-function-expression.cpp diff --git a/regression-tests/test-results/msvc-2022/pure2-for-loop-range-with-lambda.cpp.execution b/regression-tests/test-results/msvc-2022/pure2-for-loop-range-with-lambda.cpp.execution new file mode 100644 index 000000000..19b3a90b2 --- /dev/null +++ b/regression-tests/test-results/msvc-2022/pure2-for-loop-range-with-lambda.cpp.execution @@ -0,0 +1 @@ +12345123451234512345 \ No newline at end of file diff --git a/regression-tests/test-results/msvc-2022/pure2-for-loop-range-with-lambda.cpp.output b/regression-tests/test-results/msvc-2022/pure2-for-loop-range-with-lambda.cpp.output new file mode 100644 index 000000000..d6f0513de --- /dev/null +++ b/regression-tests/test-results/msvc-2022/pure2-for-loop-range-with-lambda.cpp.output @@ -0,0 +1 @@ +pure2-for-loop-range-with-lambda.cpp diff --git a/regression-tests/test-results/version b/regression-tests/test-results/version index 1517b23cc..21015bed3 100644 --- a/regression-tests/test-results/version +++ b/regression-tests/test-results/version @@ -1,5 +1,5 @@ -cppfront compiler v0.3.0 Build 8C14:0739 +cppfront compiler v0.3.0 Build 8C16:2054 Copyright(c) Herb Sutter All rights reserved SPDX-License-Identifier: CC-BY-NC-ND-4.0 diff --git a/source/build.info b/source/build.info index 6d4ce26b0..824799a30 100644 --- a/source/build.info +++ b/source/build.info @@ -1 +1 @@ -"8C14:0739" \ No newline at end of file +"8C16:2054" \ No newline at end of file diff --git a/source/to_cpp1.h b/source/to_cpp1.h index ed32bc584..9d733b9c3 100644 --- a/source/to_cpp1.h +++ b/source/to_cpp1.h @@ -4533,7 +4533,7 @@ class cppfront // "Axiom"s are for static analysis only, and are never evaluated, so just skip them // (The only requirement for an Axiom condition is that it parses; and even that's - // easy to relax if we feel like allowing arbitrary tokens in an Axiom condition) + // easy to relax if we ever want to allow arbitrary tokens in an Axiom condition) if (n.group && n.group->to_string() == "Axiom") { return; }