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
foo: () -> bool = true; S: <T: type> type one of requires below = { }
requires foo() requires (foo())
I haven't found way to write constexpr function in cpp2 which is needed here.
This could be separate issue.
Imagine foo is constexpr. But currently there is following cpp1 error:
error: use of undeclared identifier 'foo'
error: requires clause differs in template redeclaration
Because emitted declarations in that order:
template<typename T> requires( (foo()) ) class S //undeclared foo
auto foo() -> bool;
template<typename T> requires( (foo()) ) class S //template redeclaration
auto foo() -> bool { return true; }
As I understand classes declared first, so we can refer them in functions, but in this case its opposite, class declaration relies on function.
Not full issue, just several observations
foo: () -> bool = true;
S: <T: type> type
one of requires below= { }
requires foo()
requires (foo())
constexpr
function in cpp2 which is needed here.This could be separate issue.
foo
isconstexpr
. But currently there is following cpp1 error:Because emitted declarations in that order:
As I understand classes declared first, so we can refer them in functions, but in this case its opposite, class declaration relies on function.
All those give cpp2 parse error
Additional info, example of cpp1 requires with function and lambda
https://godbolt.org/z/a48YePnxe
The text was updated successfully, but these errors were encountered: