bson: provide required-but-missing virtual destructor for virtual base class#7
Open
nabijaczleweli wants to merge 2 commits intodwight:masterfrom
Open
bson: provide required-but-missing virtual destructor for virtual base class#7nabijaczleweli wants to merge 2 commits intodwight:masterfrom
nabijaczleweli wants to merge 2 commits intodwight:masterfrom
Conversation
src/bsontools/hex.cpp:81:17: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
81 | txt.empty();
| ^~~~~~~~~
1 warning generated.
Sponsored-by: https://beaverlabs.net
…e class
In file included from src/bsontools/bsonmain.cpp:10:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/memory:76:
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:95:2: warning: delete called on 'bsontools::dom::node' that is abstract but has non-virtual destructor [-Wdelete-abstract-non-virtual-dtor]
95 | delete __ptr;
| ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:396:4: note: in instantiation of member function 'std::default_delete<bsontools::dom::node>::operator()' requested here
396 | get_deleter()(std::move(__ptr));
| ^
src/bsontools/bsonmain.cpp:170:40: note: in instantiation of member function 'std::unique_ptr<bsontools::dom::node>::~unique_ptr' requested here
170 | children.push_back(unique_ptr<node>(s));
| ^
1 warning generated.
Sponsored-by: https://beaverlabs.net
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This means that derived classes' destructors won't get called.