https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82664
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|WAITING |NEW CC| |jason at gcc dot gnu.org Target Milestone|--- |7.3 Summary|Internal Compiler Error |[7/8 Regression ] ICE when |when using Match7 library |using Match7 library --- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> --- Thanks, confirmed with following reduced test-case: $ cat pr82664.ii namespace std { template < typename _Tp > struct remove_const { typedef _Tp type; }; template < typename > struct remove_reference { typedef int type; }; } namespace mch { template < typename T > struct underlying : std::remove_const< typename std::remove_reference< T >::type > {}; template < typename T, typename > struct preallocated { static T value; }; template < typename T > T *addr(T ) ; template < typename SubjectType > class unified_switch { public: typedef int static_data_type; struct local_data_type {}; static long choose; }; template < typename > struct target_disambiguator; template < typename R, typename A1 > struct target_disambiguator< R(A1 ) > { typedef A1 type; template < R (&)() > struct layout; }; } void eval(int e) { struct match_uid_type; auto subject_ptr = mch::addr(e); typedef mch::underlying< decltype(subject_ptr) >::type source_type; typedef mch::unified_switch< source_type > switch_traits; switch_traits::static_data_type static_data = mch::preallocated< switch_traits::static_data_type, match_uid_type >::value; switch_traits::local_data_type local_data; ; { void decl_helper(int ); typedef mch::target_disambiguator< decltype(decl_helper) > ::type target_type ; } $ g++ pr82664.ii causes a stack overflow with following back-trace: (gdb) bt #0 0x0000000000fc9b95 in round_up_loc(unsigned int, tree_node*, unsigned int) () #1 0x000000000111436d in layout_type(tree_node*) () #2 0x00000000012576d6 in build_function_type(tree_node*, tree_node*) () #3 0x0000000000e2003b in ?? () #4 0x0000000000e1052b in tsubst(tree_node*, tree_node*, int, tree_node*) () #5 0x0000000000e1047e in tsubst(tree_node*, tree_node*, int, tree_node*) () #6 0x0000000000e10988 in tsubst(tree_node*, tree_node*, int, tree_node*) () #7 0x0000000000e1d7d5 in ?? () #8 0x0000000000e1b8af in tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) () #9 0x0000000000e1bb50 in tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) () #10 0x0000000000e1e7a8 in tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) () #11 0x0000000000e15289 in ?? () #12 0x0000000000e0c2d6 in lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) () #13 0x0000000000e16017 in ?? () #14 0x0000000000e19b58 in ?? () #15 0x0000000000e0c331 in lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) () #16 0x0000000000e16017 in ?? () #17 0x0000000000e19b58 in ?? () #18 0x0000000000e0c331 in lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) () #19 0x0000000000e16017 in ?? () #20 0x0000000000e19b58 in ?? () #21 0x0000000000e0c331 in lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) () #22 0x0000000000e16017 in ?? () #23 0x0000000000e19b58 in ?? () Started with r241425.