https://gcc.godbolt.org/z/WVUAy5 Same error location as PR95931, but very different test case with valid code (probably). <source>: In function 'void test()': <source>:17:22: internal compiler error: in dependent_type_p, at cp/pt.c:26343 17 | func<Y<X, 0>, Y>(); | ^ Fails with -std=c++17 at least since gcc5.1 --- template < typename A, template <typename T, typename T::typeX> typename TA> auto func() { return TA<typename A::typeY, 0>{}; } struct X { using typeX = int; }; template <typename T, int> // template <typename T, typename T::typeX> // works struct Y { using typeY = T; }; void test() { func<Y<X, 0>, Y>(); } ---
trunk: internal compiler error: in dependent_type_p, at cp/pt.c:26326 10.1: internal compiler error: in dependent_type_p, at cp/pt.c:26343
Confirmed, clang accepts the code. GCC ICEs for all revisions.
(In reply to Martin Liška from comment #2) > Confirmed, clang accepts the code. GCC ICEs for all revisions. Hi, I just realized I have reported an ice-on-invalid version in bug 95931 with the same symptom in the trunk. Maybe you can consider them together. Thanks, Haoxin
Looks like a dup of bug 90782.
Further simplified code template <template <typename T, typename T::type> typename> void func() {} template <typename, int> struct Y {}; void test() { func<Y>(); }
*** Bug 95931 has been marked as a duplicate of this bug. ***
*** Bug 97624 has been marked as a duplicate of this bug. ***
Here, make_typename_type is called when tsubsting, i.e. p_t_d is 0, and it calls dependent_scope_p with a dependent type. We might need ++ptd/--ptd around the call to make_typename_type.