-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Support _
unnamed template parameter.
#812
Comments
I'm curious what the use case is for unused template parameters. Is it for specializing an existing template? |
Compilers don't seem to warn on these. |
Okay, thanks. |
Thanks! |
This is now #877. Repeat of #877It doesn't work for NTTPs: https://cpp2.godbolt.org/z/rdb6dbvv1.
template<auto _> class t {
public: template<int _> [[nodiscard]] static auto f() -> cpp2::i32;
};
|
Also require an `operator=` second parameter of the same type to be named `that` - see hsutter#475 discussion thread
Title: Support
_
unnamed template parameter.Description:
Commit 6ce2643 added support only for function parameters.
Minimal reproducer (https://cpp2.godbolt.org/z/WY56cMoTd):
Commands:
cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp
Expected result:
The template parameters to be named similar to the function parameters.
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
See also:
The text was updated successfully, but these errors were encountered: