https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84692
Bug ID: 84692 Summary: Class template argument deduction ICE for template's member template Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: colu...@gmx-topmail.de Target Milestone: --- template <typename... Ts> struct X { template <typename U> struct Y { Y(U, Ts const&... ); }; friend void begin(X) { Y{0, Ts{}...}; } }; int main() { begin(X<int>{}); } --------------- prog.cc: In substitution of 'template<class Iter> iterator(Iter, const Ts& ...)-> incrementing_range<Ts ...>::iterator<Iter> [with Iter = 128]': prog.cc:9:7: required from 'void begin(incrementing_range<int>)' prog.cc:14:34: required from here prog.cc:9:7: internal compiler error: in tsubst, at cp/pt.c:13992 iterator{0, Ts{}...}; ^~~~~~~~ --------------- I can't reduce this any further. Oddly, Clang claims this is ill-formed, while I reckon this should compile, although I haven't delved into the wording to see what it mandates regarding template members. Perhaps iterator is treated as the qualified-id X::Y, and the compilers attempt to deduce Ts, which fails?