-
Notifications
You must be signed in to change notification settings - Fork 6
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
In Tester, add virtual destructor to Table class #16
Open
brawer
wants to merge
1
commit into
Tehreer:master
Choose a base branch
from
brawer:fix-warning-delete-non-abstract-non-virtual-dtor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
In Tester, add virtual destructor to Table class #16
brawer
wants to merge
1
commit into
Tehreer:master
from
brawer:fix-warning-delete-non-abstract-non-virtual-dtor
Conversation
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 fixes 74 C++ compiler warnings when building SheenFigure with Apple clang 15.0.0. For example, after this change, the following warning does not get emitted anymore: ``` Compiling C++ object sheenfigure_tester.p/Tools_Tester_MiscTester.cpp.o In file included from ../Tools/Tester/MiscTester.cpp:19: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:290: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:20: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:66:5: warning: destructor called on non-final 'SheenFigure::Tester::OpenType::ItemVariationDataSubtable' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor] __loc->~_Tp(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:101:12: note: in instantiation of function template specialization 'std::__destroy_at<SheenFigure::Tester::OpenType::ItemVariationDataSubtable, 0>' requested here _VSTD::__destroy_at(__loc); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator_traits.h:323:16: note: in instantiation of function template specialization 'std::destroy_at<SheenFigure::Tester::OpenType::ItemVariationDataSubtable, 0>' requested here _VSTD::destroy_at(__p); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:836:25: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>>::destroy<SheenFigure::Tester::OpenType::ItemVariationDataSubtable, void, void>' requested here __alloc_traits::destroy(__alloc(), std::__to_address(--__soon_to_be_end)); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:830:29: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>::__base_destruct_at_end' requested here void __clear() _NOEXCEPT {__base_destruct_at_end(this->__begin_);} ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:446:20: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>::__clear' requested here __vec_.__clear(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/exception_guard.h:84:7: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>::__destroy_vector::operator()' requested here __rollback_(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/exception_guard.h:134:10: note: in instantiation of member function 'std::__exception_guard_exceptions<std::vector<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>::__destroy_vector>::~__exception_guard_exceptions' requested here return __exception_guard<_Rollback>(std::move(__rollback)); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:1265:25: note: in instantiation of function template specialization 'std::__make_exception_guard<std::vector<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>::__destroy_vector>' requested here auto __guard = std::__make_exception_guard(__destroy_vector(*this)); ^ ../Tools/Tester/MiscTester.cpp:156:49: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ItemVariationDataSubtable>::vector' requested here vector<ItemVariationDataSubtable> varData = { ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:66:13: note: qualify call to silence this warning __loc->~_Tp(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:66:5: warning: destructor called on non-final 'SheenFigure::Tester::OpenType::ConditionTable' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor] __loc->~_Tp(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:101:12: note: in instantiation of function template specialization 'std::__destroy_at<SheenFigure::Tester::OpenType::ConditionTable, 0>' requested here _VSTD::__destroy_at(__loc); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator_traits.h:323:16: note: in instantiation of function template specialization 'std::destroy_at<SheenFigure::Tester::OpenType::ConditionTable, 0>' requested here _VSTD::destroy_at(__p); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:836:25: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<SheenFigure::Tester::OpenType::ConditionTable>>::destroy<SheenFigure::Tester::OpenType::ConditionTable, void, void>' requested here __alloc_traits::destroy(__alloc(), std::__to_address(--__soon_to_be_end)); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:830:29: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ConditionTable>::__base_destruct_at_end' requested here void __clear() _NOEXCEPT {__base_destruct_at_end(this->__begin_);} ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:446:20: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ConditionTable>::__clear' requested here __vec_.__clear(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/exception_guard.h:84:7: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ConditionTable>::__destroy_vector::operator()' requested here __rollback_(); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/exception_guard.h:134:10: note: in instantiation of member function 'std::__exception_guard_exceptions<std::vector<SheenFigure::Tester::OpenType::ConditionTable>::__destroy_vector>::~__exception_guard_exceptions' requested here return __exception_guard<_Rollback>(std::move(__rollback)); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:1265:25: note: in instantiation of function template specialization 'std::__make_exception_guard<std::vector<SheenFigure::Tester::OpenType::ConditionTable>::__destroy_vector>' requested here auto __guard = std::__make_exception_guard(__destroy_vector(*this)); ^ ../Tools/Tester/MiscTester.cpp:209:41: note: in instantiation of member function 'std::vector<SheenFigure::Tester::OpenType::ConditionTable>::vector' requested here vector<ConditionTable> conditions = { ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:66:13: note: qualify call to silence this warning __loc->~_Tp(); ^ ```
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 fixes 74 C++ compiler warnings when building SheenFigure with Apple clang 15.0.0. For example, after this change, the following warning does not get emitted anymore: