From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C6743858C50; Tue, 27 Sep 2022 16:24:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C6743858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664295854; bh=gMAPjsVSTBiUWMbo5M5D1IAzn01caCko/4x+RDKZ7Jw=; h=From:To:Subject:Date:From; b=ZgiTB2fcVfiP7OjmI2vHCk7ArlGVbfl6aq0WcC3oFr+Q3u8khdY0uIO5HRhrw4Rop cHp/5doGObxmvzl0jts5FluU6Hq9J9XNDioO7GSetqu4KtEfEIw6mIOYbCl/tZR2+U U3zD4thJNm15zd9JHcUQqJqlOh/7KlZe0XKUqpBg= From: "gscfq@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107056] New: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr Date: Tue, 27 Sep 2022 16:24:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gscfq@t-online.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107056 Bug ID: 107056 Summary: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gscfq@t-online.de Target Milestone: --- Started with r11 between 20201122 and 20201129, test file derived from g++.dg/warn/Wunused-17.C : $ cat z1.cc int memory_consumption(const int &t) { return sizeof(t); } int s; int g() { return memory_consumption(s); } template struct X { static const int s =3D 2; }; template int f() { const unsigned int dim =3D ""; return X::s; } template int f(); static int i; template int h() { return i; } $ gcc-13-20220925 -c z1.cc -Wfloat-conversion z1.cc: In function 'int f()': z1.cc:6:28: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive] 6 | const unsigned int dim =3D ""; | ^~ | | | const char* z1.cc:7:15: internal compiler error: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr 7 | return X::s; | ^ 0x85f8f6 cxx_eval_constant_expression ../../gcc/cp/constexpr.cc:7720 0x8615b3 cxx_eval_outermost_constant_expr ../../gcc/cp/constexpr.cc:7957 0x86662a maybe_constant_value(tree_node*, tree_node*, bool) ../../gcc/cp/constexpr.cc:8227 0x92a053 fold_for_warn(tree_node*) ../../gcc/cp/expr.cc:421 0xb66b65 unsafe_conversion_p(tree_node*, tree_node*, tree_node*, bool) ../../gcc/c-family/c-common.cc:1508 0xbeeef2 conversion_warning ../../gcc/c-family/c-warn.cc:1337 0x8a9f21 cp_convert_and_check(tree_node*, tree_node*, int) ../../gcc/cp/cvt.cc:680 0x810fcd convert_like_internal ../../gcc/cp/call.cc:8432 0x81fa07 convert_like ../../gcc/cp/call.cc:8501 0x81fa07 build_converted_constant_expr_internal ../../gcc/cp/call.cc:4625 0xa74471 convert_nontype_argument ../../gcc/cp/pt.cc:7428 0xa74471 convert_template_argument ../../gcc/cp/pt.cc:8710 0xa765a3 coerce_template_parms ../../gcc/cp/pt.cc:9189 0xa78d3b lookup_template_class(tree_node*, tree_node*, tree_node*, tree_nod= e*, int, int) ../../gcc/cp/pt.cc:10032 0xad471d finish_template_type(tree_node*, tree_node*, int) ../../gcc/cp/semantics.cc:3732 0xa0ecdc cp_parser_template_id ../../gcc/cp/parser.cc:18479 0xa0f23a cp_parser_class_name ../../gcc/cp/parser.cc:25937 0xa0223e cp_parser_qualifying_entity ../../gcc/cp/parser.cc:7201 0xa0223e cp_parser_nested_name_specifier_opt ../../gcc/cp/parser.cc:6883 0xa1c07c cp_parser_simple_type_specifier ../../gcc/cp/parser.cc:19917=