forked from iains/gcc-14-branch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
2019-08-02 Martin Liska <[email protected]> * decl.c (grok_op_properties): Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators. 2019-08-02 Martin Liska <[email protected]> * g++.dg/cpp1y/new2.C: New test. From-SVN: r273996
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
2019-08-02 Martin Liska <[email protected]> | ||
|
||
* decl.c (grok_op_properties): | ||
Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators. | ||
|
||
2019-08-01 Martin Sebor <[email protected]> | ||
|
||
PR c++/90947 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
2019-08-02 Martin Liska <[email protected]> | ||
|
||
* g++.dg/cpp1y/new2.C: New test. | ||
|
||
2019-08-02 Senthil Kumar Selvaraj <[email protected]> | ||
|
||
* gcc.dg/torture/ssa-fre-6.c: Add dg-require-effective-target int32. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-O2 -std=c++17 -fdump-tree-cddce-details" } */ | ||
|
||
#include <cstdio> | ||
#include <cstdlib> | ||
#include <new> | ||
|
||
void* operator new(std::size_t sz) | ||
{ | ||
std::printf("global op new called, size = %zu\n", sz); | ||
void *ptr = std::malloc(sz); | ||
if (ptr) | ||
return ptr; | ||
else | ||
throw std::bad_alloc{}; | ||
} | ||
|
||
void operator delete(void* ptr) noexcept | ||
{ | ||
std::puts("global op delete called"); | ||
std::free(ptr); | ||
} | ||
|
||
void | ||
new_primitive_load() { | ||
int *x = new int; | ||
int tmp = *x; | ||
delete x; | ||
} | ||
|
||
void | ||
new_array_load() { | ||
int *x = new int[10]; | ||
int tmp = x[4]; | ||
delete [] x; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump-times "Deleting : _\\d+ = operator new" 2 "cddce1"} } */ | ||
/* { dg-final { scan-tree-dump-times "Deleting : operator delete" 2 "cddce1"} } */ |