Closed MaxSagebaum closed 6 months ago
That would be #877.
Thank you for the hint. I checked your reproducer with this version but my bugfix does not solve the issue.
I still get the error:
pure2-variadics.cpp2:10:20: error: declaration of template parameter ‘_’ shadows template parameter
pure2-variadics.cpp2:9:10: note: template parameter ‘_’ declared here
pure2-variadics.cpp2:10:33: error: declaration of template parameter ‘_’ shadows template parameter
pure2-variadics.cpp2:10:13: note: template parameter ‘_’ declared here
pure2-variadics.cpp2:10:62: error: expansion pattern ‘_’ contains no parameter packs
pure2-variadics.cpp2:10:65: error: template argument 1 is invalid
pure2-variadics.cpp2:10:59: error: too many template-parameter-lists
I might have a look at #877 during the next week. It should be located in the same part of the lowering.
That's because it's 2 issues in 1. You can edit the opening comment with "Resolves #877", and I will open a new one for the remaining issue.
Ok. I updated the opening comment.
I had time today to check the other error. It turned out, that this raised a few other problems.
930e70a : Fixes the missing name generation for typed template parameters. E.g.:
t: @struct <T...: _> type = {
f: <P: int> () -> i32 = 0;
}
0955521: Fixes the name clash for unnamed template parameters in different hierarchies. E.g.:
t: @struct <_...> type = {
f: <_: int> () -> i32 = 0; // Name for t<_> and t<_>::f<_> clashes both are 'UnnamedTypeParam1'
}
9612577: Fixes the missing name generation of unnamed parameters in template parameter declaration of a type. E.g.:
t: @struct <_...> type = {
f: <_: int> () -> i32 = 0; // Name for t<_> and t<_>::f<_> clashes both are 'UnnamedTypeParam1'
}
generates
template <auto ...UnnamedTypeParam1_26_14> template<int UnnamedTypeParam1_27_7> [[nodiscard]] auto t2<_...>::f() -> cpp2::i32 { return 0; }
4bc819b: Updates the other test results. (This was less than I expected.)
I do not know why the tests fail on some machines. Is this something, that has been fixed in other branches? Should I do a rebase on master?
This solves now #877 fully. I could not find any other issues this would solve. I searched for unnamed. (But probably I missed them.)
@hsutter @JohelEGP I fixed now the failures in the tests. So this pull request should now be ready for merge.
6e33f5c: Fixes also tests that are not part of this pull requests. This should clean up the testing pipeline.
Thanks!
@hsutter After merging this PR regression tests for all compilers require an update. I will prepare a PR with updates for all GCC and Clang versions. However, due to issues with GitHub Windows runners, I am unable to update MSVC tests - I don't have MSVC installed on my machine. Could you please update the MSVC tests on main
yourself?
@hsutter I've just noticed that the issue was mainly with the generated cpp files, not so much with the test-results. #941 should fix everything.
It was actually do to commit 7637c5001d8c7faff62549a5efe9afe1f9074ad9.
Resolves https://github.com/hsutter/cppfront/issues/877
Minimal example: https://cpp2.godbolt.org/z/Keozos3ae
Error:
Correct code:
I searched the issues for
...
,variadic
,semaphore
andpack
but could not find one that addresses this error.