https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101030
Bug ID: 101030 Summary: gcc internal error with Wconversion Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chrishair85 at gmail dot com Target Milestone: --- template <int N> struct jj { int ii[N ?: 1]; }; int main() { jj<2> kk; } g++ -Wconversion dies with version 8 to 11 changing template<int N> to template<unsigned long N> makes it work Regards <source>:4:18: internal compiler error: Segmentation fault 4 | int ii[N ?: 1]; | ^ 0x1780bf9 internal_error(char const*, ...) ???:0 0x6d96a9 cp_convert_and_check(tree_node*, tree_node*, int) ???:0 0x6f2dc8 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ???:0 0x707dd4 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) ???:0 0x7c0cab c_parse_file() ???:0 0x892aa2 c_common_parse_file() ???:0 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. Compiler returned: 1 Rgds