Created attachment 57818 [details] same source code as posted in the description The following code fails to compile with g++, however it works with clang. I tried various versions of gcc in godbolt (https://godbolt.org/z/xqfoc4Yce) using std=c++17 and std=c++20 and the code fails to compile on all versions. It appears that the dependent type T gets confused with the template argument of the function. template<typename A, typename... X> void works() { typename A::T var; } template<typename A, typename... T> void broken() { typename A::T var; /* A::T and T seem to clash */ } results in: <source>: In function 'void broken()': <source>:10:19: error: parameter packs not expanded with '...': 10 | typename A::T var; /* A::T and T seem to clash */ | ^~~ <source>:10:19: note: 'T'
Confirmed. Interesting: ``` template<typename A, auto... T> void works_also() { typename A::T var; /* A::T and T seem to clash */ } ``` Works also.
Oh but it is a duplicate. *** This bug has been marked as a duplicate of bug 90189 ***