Skip to content

Commit

Permalink
COMP: Locally ignore Clang -Wmismatched-tags warnings in ImageRegion
Browse files Browse the repository at this point in the history
After pull request InsightSoftwareConsortium#4367
commit 72aa9a6 (ENH: `ImageRegion` support
C++17 structured binding), a few unimportant `-Wmismatched-tags` warnings
appeared from Mac10.13-AppleClang-rel-x86_64, at
https://open.cdash.org/build/9256915

This commit locally disables those warnings, followed:
https://github.com/Naios/continuable/blob/121265df7123cf672ea8db917eaca2d0fbd9aef5/include/continuable/continuable-result.hpp#L291-L308

Reported to me by mail, from Dženan Zukić and Sean McBride.
  • Loading branch information
N-Dekker committed Feb 9, 2024
1 parent 8440914 commit b512639
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Modules/Core/Common/include/itkImageRegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ operator<<(std::ostream & os, const ImageRegion<VImageDimension> & region);

namespace std
{
#if defined(__clang__)
# pragma GCC diagnostic push
// Old Clang compiler versions (before Clang 7.0.0) produced some unimportant warnings, like: "warning: 'tuple_size'
// defined as a struct template here but previously declared as a class template"
# pragma GCC diagnostic ignored "-Wmismatched-tags"
#endif

// NOLINTBEGIN(cert-dcl58-cpp)
// Locally suppressed the following warning from Clang-Tidy (LLVM 17.0.1), as it appears undeserved.
// > warning: modification of 'std' namespace can result in undefined behavior [cert-dcl58-cpp]
Expand All @@ -448,6 +455,10 @@ struct tuple_element<VTupleIndex, itk::ImageRegion<VImageDimension>>
};

// NOLINTEND(cert-dcl58-cpp)

#if defined(__clang__)
# pragma GCC diagnostic pop
#endif
} // namespace std

#undef itkRegionOverrideMacro
Expand Down

0 comments on commit b512639

Please sign in to comment.