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

            Bug ID: 93668
           Summary: constexpr delete[]
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: euloanty at live dot com
  Target Milestone: ---

//This code should not compile because it is UB. delete a int[10000]

constexpr int f()
{
        auto p(new int[10000]);
        delete p;
        return 4;
}

int main()
{
        constexpr auto w(f());
}

//

constexpr int f()
{
        auto p(new int);
        delete[] p;
        return 4;
}

int main()
{
        constexpr auto w(f());
}

Reply via email to