https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118590
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Note, it isn't enough though. This build something and only check if it is valid later way has its drawbacks. // PR c++/118590 // { dg-do compile } template <typename T> struct A { int z; }; template <typename T, typename U> struct B { char *w; A<T> y; }; template <typename T, typename U> void foo (B<T, U> &x) { A<T> c = x.y; #pragma acc enter data copyin(__uint128_t[0 : c.z]) } void bar (B<int, int> &x) { foo (x); } ICEs during instantiation: 0x3045d59 internal_error(char const*, ...) ../../gcc/diagnostic-global-context.cc:517 0x11c640e crash_signal ../../gcc/toplev.cc:322 0x7a6adf tsubst_decl ../../gcc/cp/pt.cc:15720 0x7a979f tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/cp/pt.cc:16415 0x7caf85 tsubst_expr(tree_node*, tree_node*, int, tree_node*) ../../gcc/cp/pt.cc:22131 0x7bf112 tsubst_stmt ../../gcc/cp/pt.cc:19978