From 6e9abfabf3bc7347517abdd578ca8cf3b54a5a49 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Fri, 9 Feb 2024 16:49:26 +0100 Subject: [PATCH] COMP: Locally ignore Clang `-Wmismatched-tags` warnings in `ImageRegion` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After pull request https://github.com/InsightSoftwareConsortium/ITK/pull/4367 commit 72aa9a602bd92b665acc915d8df4bd00a27c98f0 (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. --- Modules/Core/Common/include/itkImageRegion.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Modules/Core/Common/include/itkImageRegion.h b/Modules/Core/Common/include/itkImageRegion.h index 265b4d10c300..48c9843153c2 100644 --- a/Modules/Core/Common/include/itkImageRegion.h +++ b/Modules/Core/Common/include/itkImageRegion.h @@ -424,6 +424,15 @@ operator<<(std::ostream & os, const ImageRegion & region); namespace std { +#if defined(__clang__) +# pragma GCC diagnostic push +// Old Clang compiler versions (before Clang 7.0.0) produced some unimportant warnings, saying: +// warning: 'tuple_size' defined as a struct template here but previously declared as a class template +// [-Wmismatched-tags] warning: 'tuple_element' defined as a struct template here but previously declared as a class +// template [-Wmismatched-tags] +# 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] @@ -448,6 +457,10 @@ struct tuple_element> }; // NOLINTEND(cert-dcl58-cpp) + +#if defined(__clang__) +# pragma GCC diagnostic pop +#endif } // namespace std #undef itkRegionOverrideMacro