https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78894
Bug ID: 78894
Summary: [c++17] ICE for std::list template deduction from
std:: initializer_list
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tom.m935 at hotmail dot com
Target Milestone: ---
Created attachment 40393
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40393&action=edit
Preprocessed source
The code (preprocessed attached)
#include <list>
int main() {
// Should construct std::list<int>
std::list list = { 0, 0 };
// ^
// internal compiler error: in tsubst_copy, at cp/pt.c:14727, Abort trap: 6
}
crashes on gcc 7.0.0 20161204. Expected behaviour is to construct a
std::list<int> with two 0 elements.
Command: g++ bug.ii -std=c++17 -Wall -Wextra
Error:
bug.cpp: In function 'std::__cxx11::list(std::__cxx11::list<_Tp,
_Alloc>::size_type, const value_type&, const allocator_type&)->
std::__cxx11::list<_Tp, _Alloc> [with _Tp = int; _Alloc = std::allocator<int>;
std::__cxx11::list<_Tp, _Alloc>::size_type = long unsigned int;
std::__cxx11::list<_Tp, _Alloc>::value_type = int; std::__cxx11::list<_Tp,
_Alloc>::allocator_type = std::allocator<int>]':
bug.cpp:5:29: internal compiler error: in tsubst_copy, at cp/pt.c:14727
std::list list = { 0, 0 };
^
bug.cpp:5:29: internal compiler error: Abort trap: 6
g++: internal compiler error: Abort trap: 6 (program cc1plus)