public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107056] New: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr
@ 2022-09-27 16:24 gscfq@t-online.de
  2022-09-27 16:40 ` [Bug c++/107056] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gscfq@t-online.de @ 2022-09-27 16:24 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/107056] [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr
  2022-09-27 16:24 [Bug c++/107056] New: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr gscfq@t-online.de
@ 2022-09-27 16:40 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-09-27 16:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107056

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.4
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2022-09-27

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r11-5323-g92a30040c8d3ea:

commit 92a30040c8d3ea4899979ec41a7e8e6a625c438d
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Nov 20 16:50:20 2020 -0500

    c++: ICE with int{} in template. [PR97899]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/107056] [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr
  2022-09-27 16:24 [Bug c++/107056] New: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr gscfq@t-online.de
  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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-09-29  8:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107056

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery
           Priority|P3                          |P4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/107056] [11/12/13/14 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr
  2022-09-27 16:24 [Bug c++/107056] New: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr gscfq@t-online.de
  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 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107056

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-29 10:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 16:24 [Bug c++/107056] New: [11/12/13 Regression] ICE: unexpected expression '(unsigned int)((const char*)"")' of kind implicit_conv_expr gscfq@t-online.de
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

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).