public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gscfq@t-online.de" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-107056-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107056 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 <int> struct X { static const int s = 2; }; template <typename T> int f() { const unsigned int dim = ""; return X<dim>::s; } template int f<int>(); static int i; template <typename> 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 = ""; | ^~ | | | const char* z1.cc:7:15: internal compiler error: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr 7 | return X<dim>::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_node*, 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
next reply other threads:[~2022-09-27 16:24 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-27 16:24 gscfq@t-online.de [this message] 2022-09-27 16:40 ` [Bug c++/107056] " mpolacek at gcc dot gnu.org 2022-09-29 8:00 ` rguenth at gcc dot gnu.org 2023-05-29 10:07 ` [Bug c++/107056] [11/12/13/14 " jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107056-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).