[Bug c++/104294] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.cc:13130
hewillk at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jan 31 14:08:39 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104294
--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to 康桓瑋 from comment #0)
> template<class>
> struct B;
>
> template <class R, class... Args>
> struct B<R(Args...)> {
> template<class T>
> struct C { C(T); };
> };
>
> int main() {
> B<void(int)>::C{0};
> }
>
> https://godbolt.org/z/h1jGhc5b4
In fact, if we add CATD for inner class C, it should be well-formed.
template<class>
struct B;
template <class R, class... Args>
struct B<R(Args...)> {
template<class T>
struct C { C(T); };
template<class T>
C(T) -> C<T>;
};
int main() {
B<void()>::C c{0};
}
https://godbolt.org/z/E35rj1YP5
More information about the Gcc-bugs
mailing list