https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
--- Comment #7 from fdlbxtqi ---
I mean it is a bug.
constexpr int f()
{
auto p(new int[1]);
delete p;
return 4;
}
int main()
{
constexpr auto w(f());
}
I mean this is UB so it should not compile. However, i
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
--- Comment #6 from Jonathan Wakely ---
Although "a pointer to a non-array object created by a previous new-expression"
does rule out arrays created by an array new-expression.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
--- Comment #5 from Jonathan Wakely ---
(In reply to Jakub Jelinek from comment #3)
> I found http://eel.is/c++draft/expr.delete#2 but for the non-array delete it
> talks about previous new-expression, which even the array one is.
Although it do
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
--- Comment #4 from Jonathan Wakely ---
I think it's required by http://eel.is/c++draft/new.delete#single-12 and
http://eel.is/c++draft/new.delete#array-11 which says you have to use the
matching form. delete must be used with new, and delete[] m
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
Richard Biener changed:
What|Removed |Added
Keywords||diagnostic
--- Comment #2 from Richard
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93668
--- Comment #1 from fdlbxtqi ---
constexpr int f()
{
auto p(new int[1]);
delete p;
return 4;
}
int main()
{
constexpr auto w(f());
}