Skip to content
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

Undefined Behaviour on Line 46 of BitHolder.cpp #2

Open
Spebby opened this issue Nov 5, 2024 · 0 comments
Open

Undefined Behaviour on Line 46 of BitHolder.cpp #2

Spebby opened this issue Nov 5, 2024 · 0 comments

Comments

@Spebby
Copy link

Spebby commented Nov 5, 2024

https://github.com/zaphodgjd/class-chess-123/blob/fe9cccc3af85db60f2a4e5beccf3b93fbed18547/classes/BitHolder.cpp#L46C1-L46C15

[build] C:\Users\sebbi\Documents\GitHub\CMPM123\Chess\classes\BitHolder.cpp: In member function 'void BitHolder::destroyBit()':
[build] C:\Users\sebbi\Documents\GitHub\CMPM123\Chess\classes\BitHolder.cpp:36:17: warning: deleting object of polymorphic class type 'Bit' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
[build]    36 |                 delete _bit;
[build]       |                 ^~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant