https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71451
Bug ID: 71451 Summary: ICE on invalid C++11 code on x86_64-linux-gnu: in dependent_type_p, at cp/pt.c:22599 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following code causes an ICE when compiled with the current gcc trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. This is a regression from 4.7.x (as it seems to affect 4.8.x and later). $ 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.0/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.0 20160607 (experimental) [trunk revision 237165] (GCC) $ $ g++-trunk -std=c++11 small.cpp small.cpp:6:39: error: parameter packs not expanded with ‘...’: template < typename A < T::value >::type > void foo (); ^~~~ small.cpp:6:39: note: ‘T’ small.cpp: In substitution of ‘template<typename A<T:: value>::type ...<anonymous> > void B<T>::foo() [with typename A<T:: value>::type ...<anonymous> = {}]’: small.cpp:12:10: required from here small.cpp:6:51: internal compiler error: in dependent_type_p, at cp/pt.c:22599 template < typename A < T::value >::type > void foo (); ^~~ 0x6c1b53 dependent_type_p(tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:22599 0x6c2380 dependent_scope_p(tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:22630 0x6de2e4 tsubst_qualified_id ../../gcc-source-trunk/gcc/cp/pt.c:13753 0x6df3d4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:16224 0x6d401f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-source-trunk/gcc/cp/pt.c:15820 0x6ea07c tsubst_template_arg ../../gcc-source-trunk/gcc/cp/pt.c:10391 0x6f9482 tsubst_template_args ../../gcc-source-trunk/gcc/cp/pt.c:11234 0x6fe28b tsubst_aggr_type ../../gcc-source-trunk/gcc/cp/pt.c:11431 0x6e7121 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:13432 0x6f95de tsubst_template_args ../../gcc-source-trunk/gcc/cp/pt.c:11226 0x6f96fa tsubst_template_args ../../gcc-source-trunk/gcc/cp/pt.c:11194 0x6eff05 tsubst_decl ../../gcc-source-trunk/gcc/cp/pt.c:11726 0x6e799e tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:12829 0x6ffbcd instantiate_template_1 ../../gcc-source-trunk/gcc/cp/pt.c:17421 0x6ffbcd instantiate_template(tree_node*, tree_node*, int) ../../gcc-source-trunk/gcc/cp/pt.c:17472 0x71161c fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool) ../../gcc-source-trunk/gcc/cp/pt.c:17847 0x67243b add_template_candidate_real ../../gcc-source-trunk/gcc/cp/call.c:3110 0x67316c add_template_candidate ../../gcc-source-trunk/gcc/cp/call.c:3188 0x67316c add_candidates ../../gcc-source-trunk/gcc/cp/call.c:5361 0x673a06 build_new_method_call_1 ../../gcc-source-trunk/gcc/cp/call.c:8313 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 > struct A; template < typename ... T > struct B { template < typename A < T::value >::type > void foo (); }; int main () { B < int > t; t.foo (); return 0; }