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

            Bug ID: 79372
           Summary: ICE on C++ code with illegal decomposition declaration
                    on x86_64-linux-gnu: in tsubst_decomp_names, at
                    cp/pt.c:15599
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.1 20170203 (experimental) [trunk revision 245142] (GCC) 
$ 
$ g++-trunk -c -std=c++1z small.cpp
small.cpp: In member function ‘void S<T>::f()’:
small.cpp:4:20: error: cannot decompose non-array non-class type ‘int’
   void f () { auto [x] = 0; }
                    ^~~
small.cpp: In instantiation of ‘void S<T>::f() [with T = int]’:
small.cpp:10:8:   required from here
small.cpp:4:20: internal compiler error: in tsubst_decomp_names, at
cp/pt.c:15599
0x70aa06 tsubst_decomp_names
        ../../gcc-source-trunk/gcc/cp/pt.c:15599
0x6f56db tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:15773
0x6f1da3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:15879
0x6ef204 instantiate_decl(tree_node*, bool, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:22818
0x73e5a2 instantiate_pending_templates(int)
        ../../gcc-source-trunk/gcc/cp/pt.c:22939
0x783a01 c_parse_final_cleanups()
        ../../gcc-source-trunk/gcc/cp/decl2.c:4525
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


-------------------------------------


template < typename T > struct S
{
  enum E { A };
  void f () { auto [x] = 0; }
};

int main ()
{
  S < int > s;
  s.f ();
  return 0;
}

Reply via email to