[LLVMdev] Operation on argument of 2d array of templated class can NOT pass llvm-gcc
Duncan Sands
baldrick at free.fr
Mon Jul 12 00:58:40 PDT 2010
As some extra data points, gcc-4.5, gcc-4.2 and clang all accept this code.
> 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.
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list