public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108266] New: [13 Regression] ICE during cxx_eval_constant_expression on IMPLICIT_CONV_EXPR since r13-4564
@ 2023-01-02 16:32 jakub at gcc dot gnu.org
  2023-01-02 16:33 ` [Bug c++/108266] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-02 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108266
           Summary: [13 Regression] ICE during
                    cxx_eval_constant_expression on IMPLICIT_CONV_EXPR
                    since r13-4564
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

#include <initializer_list>
#include <vector>

struct S { S (const char *); };
void bar (std::vector<S>);

template <int N>
void
foo ()
{
  bar ({"", ""});
}

void
baz ()
{
  foo<0> ();
}

ICEs with -std=c++20 starting with
r13-4564-gd081807d8d70e3e87eae41e1560e54d503f4d465
internal compiler error: unexpected expression '(S)""' of kind
implicit_conv_expr
   11 |   bar ({"", ""});
      |   ~~~~^~~~~~~~~~
In Fedora test mass rebuilds I saw 33 ICEs like that.
Instead of the includes one can use just
namespace std {
template <class T> struct initializer_list { const T *ptr; decltype (sizeof 0)
len; };
template <typename T> struct vector { vector (initializer_list<T>); };
}
to get the same ICE.

The problem is that maybe_init_list_as_range -> maybe_init_list_as_array ->
maybe_constant_init is called when processing_template_decl (from
build_user_type_conversion_1).  Wonder if the call shouldn't be skipped for
processing_template_decl, or whether say maybe_init_list_as_range shouldn't
always return NULL if processing_template_decl.

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

end of thread, other threads:[~2023-01-09 22:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 16:32 [Bug c++/108266] New: [13 Regression] ICE during cxx_eval_constant_expression on IMPLICIT_CONV_EXPR since r13-4564 jakub at gcc dot gnu.org
2023-01-02 16:33 ` [Bug c++/108266] " jakub at gcc dot gnu.org
2023-01-02 16:41 ` pinskia at gcc dot gnu.org
2023-01-09 22:41 ` cvs-commit 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).