jacobchen
2010-Jul-12 07:10 UTC
[LLVMdev] Operation on argument of 2d array of templated class can NOT pass llvm-gcc
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>
Duncan Sands
2010-Jul-12 07:58 UTC
[LLVMdev] Operation on argument of 2d array of templated class can NOT pass llvm-gcc
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