Operation on argument of 2d array of templated class can NOT pass llvm-gcc

for example:

template <int N>
class T {
  int V;

T<4> test(T<4> a[4][8]) {
  return a[3][3];

in LLVM23 release, it will crash llvm-gcc,

test.cpp: In function \u2018T<4> test(T<4> (*)[8])\u2019:
test.cpp:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:[http://llvm.org/bugs/](http://llvm.org/bugs/)> for instructions.

in TOT llvm-gcc (r108122)
it can NOT pass syntax check:
test.cpp: In function '8T<4> test(T<4> (*)[8])':
test.cpp:7: error: invalid use of incomplete type 'class T<4>'
test.cpp:2: error: declaration of 'class T<4>'

Who can help explain the reason? How can we get around the issue?

As some extra data points, gcc-4.5, gcc-4.2 and clang all accept this code.