https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77338
Bug ID: 77338 Summary: ICE on invalid C++11 code on x86_64-linux-gnu: Segmentation fault 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: --- This is a regression from 6.x. $ 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 20160822 (experimental) [trunk revision 239655] (GCC) $ $ g++-trunk -c small.cpp small.cpp:3:51: internal compiler error: Segmentation fault template < typename > auto f (S s)->decltype (s (s)); ^ 0xdd5bff crash_signal ../../gcc-source-trunk/gcc/toplev.c:335 0x749d5b tree_check ../../gcc-source-trunk/gcc/tree.h:3022 0x749d5b is_really_empty_class(tree_node*) ../../gcc-source-trunk/gcc/cp/class.c:8447 0x8b7832 cxx_eval_constant_expression ../../gcc-source-trunk/gcc/cp/constexpr.c:3750 0x8bdba9 cxx_eval_outermost_constant_expr ../../gcc-source-trunk/gcc/cp/constexpr.c:4390 0x8c10fe fold_non_dependent_expr(tree_node*) ../../gcc-source-trunk/gcc/cp/constexpr.c:4669 0x6c98e4 build_non_dependent_expr(tree_node*) ../../gcc-source-trunk/gcc/cp/pt.c:23818 0x821b50 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc-source-trunk/gcc/cp/semantics.c:2329 0x798780 cp_parser_postfix_expression ../../gcc-source-trunk/gcc/cp/parser.c:6937 0x79993d cp_parser_decltype_expr ../../gcc-source-trunk/gcc/cp/parser.c:13266 0x79993d cp_parser_decltype ../../gcc-source-trunk/gcc/cp/parser.c:13367 0x797bf7 cp_parser_simple_type_specifier ../../gcc-source-trunk/gcc/cp/parser.c:16258 0x793e71 cp_parser_type_specifier ../../gcc-source-trunk/gcc/cp/parser.c:16049 0x7963e2 cp_parser_type_specifier_seq ../../gcc-source-trunk/gcc/cp/parser.c:20184 0x7a0ac2 cp_parser_type_id_1 ../../gcc-source-trunk/gcc/cp/parser.c:20046 0x7a0286 cp_parser_trailing_type_id ../../gcc-source-trunk/gcc/cp/parser.c:20118 0x7a0286 cp_parser_late_return_type_opt ../../gcc-source-trunk/gcc/cp/parser.c:19958 0x7a0286 cp_parser_direct_declarator ../../gcc-source-trunk/gcc/cp/parser.c:19147 0x7a0286 cp_parser_declarator ../../gcc-source-trunk/gcc/cp/parser.c:18967 0x7b6035 cp_parser_init_declarator ../../gcc-source-trunk/gcc/cp/parser.c:18512 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. $ --------------------------------------------------------- struct S; //OK: struct S { void operator () (S); }; template < typename > auto f (S s)->decltype (s (s));