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

            Bug ID: 114935
           Summary: Miscompilation of initializer_list<std::string> in
                    presence of exceptions
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux-gnu
            Target: x86_64-linux-gnu

The following testcase:

#include <string>
#include <initializer_list>

void __attribute__((noipa))
tata(std::initializer_list<std::string> init)
{
  throw 1;
}

int
main()
{
  try
    {
      tata({ "0123456789012346" }); // using shorter string or "..."s works
    }
  catch (...)
    {
    }
}

aborts when compiled with GCC 14 even when not optimizing.

I have bisected the failure to r14-1705-g2764335bd336f2 (Jason
Merrill: c++: build initializer_list<string> in a loop [PR105838])

This has been extracted from libstorage-ng testsuite and originally
filed as https://bugzilla.opensuse.org/show_bug.cgi?id=1223820

Reply via email to