public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107280] New: ICE: tree check: expected constructor, have view_convert_expr in cxx_eval_store_expression, at cp/constexpr.cc:5928
@ 2022-10-16 19:16 jwjagersma at gmail dot com
  2022-10-17 11:42 ` [Bug c++/107280] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jwjagersma at gmail dot com @ 2022-10-16 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107280
           Summary: ICE: tree check: expected constructor, have
                    view_convert_expr in cxx_eval_store_expression, at
                    cp/constexpr.cc:5928
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwjagersma at gmail dot com
  Target Milestone: ---

Created attachment 53710
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53710&action=edit
output from -freport-bug

Ran into this today, while trying to do some basic string manipulation:

    $ cat ~/ice.cpp
    struct string
    {
      char str[8] = "       ";
      const char* data() { return str; }
    };

    template<bool a, bool b>
    consteval string test()
    {
      string str { };
      char* p = str.str;

      auto append = [&p](const char* s)
      {
        while (*s != '\0') *p++ = *s++;
        ++p;
      };

      if (a) append("abc");
      if (b) append("xyz");
      return str;
    }

    auto f() { return test<true,true>(); }

    $ g++ -std=c++20 ~/ice.cpp
    /home/jw/ice.cpp: In function 'auto f()':
    /home/jw/ice.cpp:24:34:   in 'constexpr' expansion of 'test<true, true>()'
    /home/jw/ice.cpp:19:16:   in 'constexpr' expansion of 'append.test<true,
true>()::<lambda(const char*)>(((const char*)"abc"))'
    /home/jw/ice.cpp:24:34: internal compiler error: tree check: expected
constructor, have view_convert_expr in cxx_eval_store_expres
    sion, at cp/constexpr.cc:5928
       24 | auto f() { return test<true,true>(); }
          |                   ~~~~~~~~~~~~~~~^~
    ...

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

end of thread, other threads:[~2023-03-15 18:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 19:16 [Bug c++/107280] New: ICE: tree check: expected constructor, have view_convert_expr in cxx_eval_store_expression, at cp/constexpr.cc:5928 jwjagersma at gmail dot com
2022-10-17 11:42 ` [Bug c++/107280] " marxin at gcc dot gnu.org
2022-10-17 20:47 ` mpolacek at gcc dot gnu.org
2023-03-08 22:08 ` [Bug c++/107280] [10/11/12/13 Regression] " mpolacek at gcc dot gnu.org
2023-03-08 22:40 ` mpolacek at gcc dot gnu.org
2023-03-08 22:46 ` mpolacek at gcc dot gnu.org
2023-03-15 18:28 ` cvs-commit at gcc dot gnu.org
2023-03-15 18:29 ` cvs-commit at gcc dot gnu.org
2023-03-15 18:30 ` [Bug c++/107280] [10/11 " mpolacek 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).