-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warning about delete not matching new #4989
Conversation
@@ -75,6 +75,7 @@ class Type_Any : Type, ITypeVar { | |||
protected: | |||
#emit | |||
void *operator new(size_t size) { return ::operator new(size); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need new override for these nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was done to make them protected rather than public, so that other code could not directly call new
and had to call the appropriate get
method instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, I missed that get
methods.
23d4fcd
to
a5577c6
Compare
Signed-off-by: Chris Dodd <[email protected]>
Looks like this broke sanitizers build |
Yup, the nightly failed: https://github.com/p4lang/p4c/actions/runs/11621767033/job/32366099914 |
GCC 10 does not enable sized deallocation by default. We need to make these |
We'd likely need to guard these with |
New gcc versions (11+) give a slew of warnings about a mismatched operator delete being called from a new expression. This trivial change fixes those warnings.