https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63786

            Bug ID: 63786
           Summary: crash on argument pack in switch case
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rhainin1 at binghamton dot edu

Created attachment 33924
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33924&action=edit
minimal code to reproduce

using "case Is:" where Is is an argument pack (invalid code) causes gcc to
crash.

gcc-4.9.2 configured with "--enable-languages=c,c++" on 64-bit Debian 7.4

I have also compiled with -Wall -Wextra -pedantic -g and tried -std=c++14, with
no difference.
$ g++ -std=c++11 expandcase.cpp 
expandcase.cpp: In instantiation of ‘int f(int) [with int ...Is = {1, 2, 3}]’:
expandcase.cpp:10:15:   required from here
expandcase.cpp:4:9: internal compiler error: unexpected expression ‘Is’ of kind
template_parm_index
         case Is:
         ^
0x66b440 cxx_eval_constant_expression
    ../../src/gcc/cp/semantics.c:9822
0x66cf16 cxx_eval_outermost_constant_expr
    ../../src/gcc/cp/semantics.c:9842
0x5a9d99 finish_case_label(unsigned int, tree_node*, tree_node*)
    ../../src/gcc/cp/decl.c:3190
0x5ce90c tsubst_expr
    ../../src/gcc/cp/pt.c:13675
0x5ce7e4 tsubst_expr
    ../../src/gcc/cp/pt.c:13443
0x5cee5d tsubst_expr
    ../../src/gcc/cp/pt.c:13648
0x5ce092 tsubst_expr
    ../../src/gcc/cp/pt.c:13668
0x5cee5d tsubst_expr
    ../../src/gcc/cp/pt.c:13648
0x5cdc12 instantiate_decl(tree_node*, int, bool)
    ../../src/gcc/cp/pt.c:19971
0x5e483b instantiate_pending_templates(int)
    ../../src/gcc/cp/pt.c:20087
0x5fd24f cp_write_global_declarations()
    ../../src/gcc/cp/decl2.c:4340

Reply via email to