You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build/_cppfront/main.cpp:20:25: error: no matching function for call to 'assert_in_bounds'
cpp2::Default.expects(cpp2::assert_in_bounds(t(), 1, 2)==42, "");
^~~~~~~~~~~~~~~~~~~~~~
raw.githubusercontent.com/hsutter/cppfront/main/include/cpp2util.h:399:6: note: candidate function template not viable: requires 2 arguments, but 3 were provided
auto assert_in_bounds(auto&& x, auto&& arg CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAULT) -> decltype(auto)
^
raw.githubusercontent.com/hsutter/cppfront/main/include/cpp2util.h:407:6: note: candidate function template not viable: requires 2 arguments, but 3 were provided
auto assert_in_bounds(auto&& x, auto&& arg CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAULT) -> decltype(auto)
^
The text was updated successfully, but these errors were encountered:
Title: No support for multi-argument indexing.
Description:
An expression like
x[y,z]
lowers to
cpp2::assert_in_bounds(x, y, z)
,but has an arity of 2.
Minimal reproducer (https://cpp2.godbolt.org/z/TPoGe1czc):
Commands:
cppfront -clean-cpp1 main.cpp2 clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -I . main.cpp
Expected result:
It doesn't seem trivial to support multi-argument indexing in
cpp2::assert_in_bounds
.See https://en.cppreference.com/w/cpp/container/mdspan/operator_at.
Actual result and error:
Cpp2 lowered to Cpp1.
Output.
The text was updated successfully, but these errors were encountered: