http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50626
Bug #: 50626 Summary: ICE with non-variadic function arguments after variadic one Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: kyu...@gmail.com ICE is raised with the following source code. I'm not sure if it's valid code. =============================================== template <typename... T> int f(T*... x, int y) { return y; } int main() { f(1); return 0; } ================================================= Following is the command line options and the compiler output. ================================================= $ g++-4.6.1 -v -save-temps -std=c++0x -Wall haha.cc Using built-in specs. COLLECT_GCC=g++-4.6.1 COLLECT_LTO_WRAPPER=/usr/local/packages/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.6.1/configure --prefix=/usr/local/packages/gcc-4.6.1 Thread model: posix gcc version 4.6.1 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-Wall' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/local/packages/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus -E -quiet -v -D_GNU_SOURCE haha.cc -mtune=generic -march=x86-64 -std=c++0x -Wall -fpch-preprocess -o haha.ii ignoring nonexistent directory "/usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1 /usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/x86_64-unknown-linux-gnu /usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/backward /usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include /usr/local/include /usr/local/packages/gcc-4.6.1/include /usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-Wall' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/local/packages/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus -fpreprocessed haha.ii -quiet -dumpbase haha.cc -mtune=generic -march=x86-64 -auxbase haha -Wall -std=c++0x -version -o haha.s GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 89dcf4f0326a9a75d3a96096777c9003 haha.cc: In function ‘int f(T* ..., int) [with T = {}]’: haha.cc:9:5: instantiated from here haha.cc:4:9: internal compiler error: in tsubst_copy, at cp/pt.c:11305 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. ========================================================