diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/array8.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/array8.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/array8.C b/gcc/testsuite/g++.dg/template/array8.C new file mode 100644 index 000000000..9fd33a4aa --- /dev/null +++ b/gcc/testsuite/g++.dg/template/array8.C @@ -0,0 +1,16 @@ +// PR c++/18121 + +// We were trying to layout the array +// type but since the type/value of A<N>::i +// was not known at template declation type, +// we were crashing + +template<int> struct A +{ + static int const i = 1; +}; + +template<int N> struct B +{ + typedef int (*p)[A<N>::i]; +}; |