COMP: Fix MSVC error C2516: 'ConstIterator': is not a legal base class#3844
Conversation
|
Thanks to Bernhard Froehler (@codeling) for confirming that the errors go away with this fix, at https://discourse.itk.org/t/itk-build-error-in-itk-shapedneighborhooditerator/4861/19 |
|
|
||
| /** An iterator for the ShapedNeighborhood classes. */ | ||
| struct Iterator : public ConstIterator | ||
| struct Iterator : public Superclass::ConstIterator |
There was a problem hiding this comment.
Note: Instead of this adjustment (deriving from Superclass::ConstIterator), we could also restore using ConstIterator = typename Superclass::ConstIterator; as in
It looks like these MSVC /permissive- errors were triggered by pull request #2567 commit 4f30980 "STYLE: Avoid repeating parent aliases", merged on September 21, 2021. I still think it may be an MSVC compiler bug anyway.
|
PR converted back to draft, because this error appears elsewhere in ITK as well, when doing |
Works around compile errors that appeared using Visual C++ compiler flag
`/permissive-` ("Conformance mode"), using either VS2019 or VS2022, saying:
> error C2516: 'ConstIterator': is not a legal base class
> error C2516: 'GlobalDataStruct': is not a legal base class
Originally reported by Astha, March 14, 2022, and further discussed at
"ITK build Error in itk::ShapedNeighborhoodIterator",
https://discourse.itk.org/t/itk-build-error-in-itk-shapedneighborhooditerator/4861
872fa19 to
ad1277b
Compare
|
Please check the bug report I submitted to Microsoft on this compile error: Class template gets undeserved error C2516: "is not a legal base class" from https://developercommunity.visualstudio.com/t/Class-template-gets-undeserved-error-C25/10243790 |
Originally reported by Astha, March 14, 2022, and further discussed at "ITK build Error in itk::ShapedNeighborhoodIterator", https://discourse.itk.org/t/itk-build-error-in-itk-shapedneighborhooditerator/4861