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

            Bug ID: 104007
           Summary: new (std::nothrow) S[n] always calls ~S
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com
  Target Milestone: ---

Apparently a recent regression on GCC trunk:

> $ cat test.cc
> #include <cstdlib>
> #include <new>
> struct S { ~S() { std::abort(); } };
> int main() {
>     new (std::nothrow) S[1];
> }

> $ g++ test.cc
> $ ./a.out
> Aborted (core dumped)

Reply via email to