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
I encountered this when poking Cppfront to get it to emit a type-constraint.
The issue is alleviated by resolving #425,
as it would only happen with an NTTP by copy.
Yes, I know it's not supported, and did it intentionally anyways.
What I'm wondering is whether Cppfront should diagnose
the function definitions of those calls in the reproducer that say // Not OK (works, should error).
Because it knows T is an NTTP, yet allows T to be used as a type-id.
That isn't yet supported, but my intent is to spell it as <T: type is std::regular>.
I'm supposing we will be able to omit type, and similarly declare NTTPs like <V: _ is std::regular>.
And similarly support this terse syntax on parameters, return types, and variable declarations (just like Cpp1), e.g.
f: <_: type is C, _: is C, _: _ is C> (_: _ is C, _: is C) -> _ is C { _: _ is C = …; }
Title: Non-type template parameter used as type-id is not diagnosed.
Description:
I encountered this when poking Cppfront to get it to emit a type-constraint.
The issue is alleviated by resolving #425,
as it would only happen with an NTTP by
copy
.Minimal reproducer (https://cpp2.godbolt.org/z/WehjhjPjY):
Commands:
cppfront main.cpp2 clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -fsanitize=undefined -Werror=unused-result -I . main.cpp
Expected result: A diagnostic when using an NTTP as a type.
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
The text was updated successfully, but these errors were encountered: