Created attachment 43847 [details] Reproducer The downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1562194 describes an ICE due to this assertion failing: 8243 gcc_assert (!force_elide); I'm attaching a minimized reproducer, which ICEs on current trunk (r259106), with -std=c++1z. $ ./xg++ -B. -c /tmp/rhbz1562194.cc -std=c++1z /tmp/rhbz1562194.cc: In constructor ‘buffer_info::buffer_info(any_container<int>)’: /tmp/rhbz1562194.cc:17:66: internal compiler error: in build_over_call, at cp/call.c:8243 buffer_info(any_container<int> shape_in) : shape(move(shape_in)) {} ^ 0x823faa build_over_call ../../src/gcc/cp/call.c:8243 0x8298e3 build_new_method_call_1 ../../src/gcc/cp/call.c:9366 0x829f29 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) ../../src/gcc/cp/call.c:9441 0x826f1b build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, int) ../../src/gcc/cp/call.c:8969 0x954e20 expand_default_init ../../src/gcc/cp/init.c:1887 0x9554a3 expand_aggr_init_1 ../../src/gcc/cp/init.c:2002 0x954053 build_aggr_init(tree_node*, tree_node*, int, int) ../../src/gcc/cp/init.c:1742 0x950227 perform_member_init ../../src/gcc/cp/init.c:847 0x9527d3 emit_mem_initializers(tree_node*) ../../src/gcc/cp/init.c:1293 0xad0a7c finish_mem_initializers(tree_node*) ../../src/gcc/cp/semantics.c:1704 0x9e03b5 cp_parser_mem_initializer_list ../../src/gcc/cp/parser.c:14440 0x9dfc74 cp_parser_ctor_initializer_opt ../../src/gcc/cp/parser.c:14353 0x9eeb48 cp_parser_ctor_initializer_opt_and_function_body ../../src/gcc/cp/parser.c:21803 0x9f9053 cp_parser_function_definition_after_declarator ../../src/gcc/cp/parser.c:26839 0x9fb8dc cp_parser_late_parsing_for_member ../../src/gcc/cp/parser.c:27719 0x9f141a cp_parser_class_specifier_1 ../../src/gcc/cp/parser.c:22757 0x9f14f7 cp_parser_class_specifier ../../src/gcc/cp/parser.c:22783 0x9e43a8 cp_parser_type_specifier ../../src/gcc/cp/parser.c:16766 0x9de948 cp_parser_decl_specifier_seq ../../src/gcc/cp/parser.c:13617 0x9dd071 cp_parser_simple_declaration ../../src/gcc/cp/parser.c:12927 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.
Started somewhere between r258751 (unaffected) and r258755 (affected)
(In reply to David Malcolm from comment #1) > Started somewhere between r258751 (unaffected) and r258755 (affected) Probably started at r258755 (fix for PR c++/81311)
I don't think this is just an ICE on invalid: we can trivially fix the snippet as: template <typename _Tp> struct remove_reference {}; template <typename _Tp> struct remove_reference<_Tp &> { typedef _Tp type; }; template <typename _Tp> constexpr typename remove_reference<_Tp>::type &&move(_Tp &&__t) noexcept { return static_cast<typename remove_reference<_Tp>::type&&>(__t); } template <typename _Tp> struct vector { vector(vector &&) noexcept {} }; template <typename T> struct any_container { vector<T> v; operator vector<T> &&() && { return move(v); } }; struct buffer_info { vector<int> shape; buffer_info(any_container<int> shape_in) : shape(move(shape_in)) {} };
Fixed.
Author: jason Date: Thu Apr 5 04:01:15 2018 New Revision: 259123 URL: https://gcc.gnu.org/viewcvs?rev=259123&root=gcc&view=rev Log: PR c++/85215 - ICE with copy-init from conversion. * call.c (merge_conversion_sequences): Fix type of direct binding sequence. Added: trunk/gcc/testsuite/g++.dg/cpp1z/elide3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c