Closed JohelEGP closed 7 months ago
Title: NTTP can't be variadic or unnamed.
Minimal reproducer (https://cpp2.godbolt.org/z/rdb6dbvv1):
t: @struct <_...: _> type = { f: <_: int> () -> i32 = 0; } main: () = { }
Expected result:
Actual result and error:
template<auto _> class t { public: template<int _> [[nodiscard]] static auto f() -> cpp2::i32; };
Output:
main.cpp2:2:24: error: declaration of '_' shadows template parameter 2 | public: template<int _> [[nodiscard]] static auto f() -> cpp2::i32; | ^ main.cpp2:1:15: note: template parameter is declared here 1 | template<auto _> class t { | ^
See also:
Title: NTTP can't be variadic or unnamed.
Minimal reproducer (https://cpp2.godbolt.org/z/rdb6dbvv1):
Commands:
```bash cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -I . main.cpp ```Expected result:
812 for NTTPs.
Actual result and error:
Cpp2 lowered to Cpp1:
```C++ //=== Cpp2 type declarations ==================================================== #include "cpp2util.h" #line 1 "/app/example.cpp2" templateOutput:
See also: