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

            Bug ID: 79420
           Summary: ICE on invalid C++ code on x86_64-linux-gnu: in
                    tsubst_copy, at cp/pt.c:14573
           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: ---

This seems to be a recent regression. 

$ 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 20170207 (experimental) [trunk revision 245240] (GCC)
$
$ g++-trunk -c -w small.cpp
small.cpp: In instantiation of ‘int f() [with int <anonymous> = 0]’:
small.cpp:8:12:   required from here
small.cpp:3:12: internal compiler error: in tsubst_copy, at cp/pt.c:14573
   return f.x;
          ~~^
0x6f90b0 tsubst_copy
        ../../gcc-source-trunk/gcc/cp/pt.c:14573
0x6fe380 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:17858
0x6fe8ae tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:17458
0x6f1957 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:16405
0x6f315c tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:15666
0x6f2153 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:15882
0x6ef5b4 instantiate_decl(tree_node*, bool, bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:22821
0x73e9a2 instantiate_pending_templates(int)
        ../../gcc-source-trunk/gcc/cp/pt.c:22942
0x783e01 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 < int > int f ()
{ 
  return f.x;
}

void g ()
{ 
  f < 0 > ();
}

Reply via email to