From a54d96b72279e4426ca21190951b2c0c5401cb74 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sat, 7 Mar 2020 13:34:43 +0200 Subject: cmAlgorithms: Fix -Wnon-c-typedef-for-linkage warnings In commit bf1e73305a (cmAlgorithms: Refactor cmRemoveDuplicates, 2019-03-03, v3.15.0-rc1~414^2) we added `union X = struct {}`. C++ had a rule change whereby only C-compatible unnamed typedefs are allowed. Clang 11 warns about this by default. See https://reviews.llvm.org/D74103. The aliases don't seem to be necessary, so simply define as structs. --- Source/cmAlgorithms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index 19da2a0..c0ac551 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -139,7 +139,7 @@ template ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last) { using Value = typename std::iterator_traits::value_type; - using Hash = struct + struct Hash { std::size_t operator()(ForwardIterator it) const { @@ -147,7 +147,7 @@ ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last) } }; - using Equal = struct + struct Equal { bool operator()(ForwardIterator it1, ForwardIterator it2) const { -- cgit v0.12