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

jacobchen chen.youxiang1002 at gmail.com
Mon Jul 12 00:10:28 PDT 2010


for example:

template <int N>
class T {
public:
  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/> 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?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100712/952e15ec/attachment.html>


More information about the llvm-dev mailing list