COMP: Remove in class init of SmartPointer of forward declaration#3927
Merged
N-Dekker merged 1 commit intoInsightSoftwareConsortium:masterfrom Feb 17, 2023
Merged
Conversation
GCC 7.4.1 raised the following errors on Linux:
Modules/Core/Common/include/itkSmartPointer.h:214:18: error: invalid use
of incomplete type ‘using ObjectType = class itk::MultiThreaderBase {aka
class itk::MultiThreaderBase}’
This is a compiler bug (as discussed in
InsightSoftwareConsortium#3877 (comment))
and the same issue has been fixed for unique_ptr by
719c3ce.
Contributor
|
Thanks again @SimonRit It is indeed quite similar to the problem you fixed with #3877 It appears to be an old GCC bug, fixed with GCC 9.2. I just tried the following minimal example at https://godbolt.org/z/bP6frqqKo The existence of a templated constructor |
N-Dekker
approved these changes
Feb 15, 2023
Contributor
|
/azp run ITK.Linux.Python |
N-Dekker
added a commit
to N-Dekker/ITKSoftwareGuide
that referenced
this pull request
Mar 1, 2023
Excluded padding data, `std::unique_ptr`, `itk::SmartPointer` and low level utility classes from the guideline that says that "all member variables must be initialized when they are declared". `std::unique_ptr` and `itk::SmartPointer` are excluded because of some GCC compile errors, which were addressed in ITK by Simon Rit: - pull request InsightSoftwareConsortium/ITK#3877 commit InsightSoftwareConsortium/ITK@eac289d "COMP: Remove in-class {} member initializers of unique_ptr" - pull request InsightSoftwareConsortium/ITK#3927 commit InsightSoftwareConsortium/ITK@f5f8367 "COMP: Remove in class init of SmartPointer of forward declaration"
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.
GCC 7.4.1 raised the following errors on Linux:
Modules/Core/Common/include/itkSmartPointer.h:214:18: error: invalid use of incomplete type ‘using ObjectType = class itk::MultiThreaderBase {aka class itk::MultiThreaderBase}’
This is a compiler bug (as discussed in
#3877 (comment)) and the same issue has been fixed for unique_ptr by 719c3ce.
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.