[Bug c++/47326] [4.4/4.5/4.6 Regression] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47326 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added Priority|P3 |P2 --- Comment #6 from Richard Guenther rguenth at gcc dot gnu.org 2011-02-08 14:13:31 UTC --- Calling this a regression is interesting. GCC 4.3 rejects the code: /space/rguenther/install/gcc-4.3.5/bin/g++ -S t.ii -std=c++0x ../src/simple-tests/bug-gcc-ICE-return_type_depends_on_variadic_size.cpp:7: error: expected initializer before '-' token ../src/simple-tests/bug-gcc-ICE-return_type_depends_on_variadic_size.cpp: In function 'int main()': ../src/simple-tests/bug-gcc-ICE-return_type_depends_on_variadic_size.cpp:12: error: 'f' was not declared in this scope it remains to be stated whether the code is valid or not, ICEing instead of rejecting it is a regression.
[Bug c++/47326] [4.4/4.5/4.6 Regression] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47326 --- Comment #8 from Jonathan Wakely redi at gcc dot gnu.org 2011-02-08 14:30:36 UTC --- The code is valid C++0x (so the summary should include [C++0x]) It doesn't ICE if sizeof...(_ARGS) is used instead of sizeof...(args), or if the sizeof... expression occurs in the function body rather than the trailing-return-type e.g this compiles: template int struct A { }; template typename... _ARGS auto f (_ARGS... args) - Asizeof...(_ARGS) { return {}; } int main() { f(1,2); } and so does this: template int struct A { }; template typename... _ARGS A2 f (_ARGS... args) { return Asizeof...(args){}; } int main() { f(1,2); } but not this: template int struct A { }; template typename... _ARGS auto f (_ARGS... args) - Asizeof...(args) { return {}; } int main() { f(1,2); }
[Bug c++/47326] [4.4/4.5/4.6 Regression] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47326 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Status|WAITING |NEW Target Milestone|--- |4.4.6 Summary|ICE in tsubst_copy |[4.4/4.5/4.6 Regression] |(triggered by dependency of |ICE in tsubst_copy |return type on parameter|(triggered by dependency of |pack size) |return type on parameter ||pack size) --- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2011-01-18 14:13:14 UTC --- It is caused by revision 145013: http://gcc.gnu.org/ml/gcc-cvs/2009-03/msg00520.html