diff options
author | Raul Tambre <raul@tambre.ee> | 2020-03-07 11:34:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-09 13:21:25 (GMT) |
commit | a54d96b72279e4426ca21190951b2c0c5401cb74 (patch) | |
tree | 38e919525c1e823bf049ce1fc6b28a97bb253992 /Source/cmAlgorithms.h | |
parent | d1cb554c99c73e1486fbf4e09125337a7c0e9ea3 (diff) | |
download | CMake-a54d96b72279e4426ca21190951b2c0c5401cb74.zip CMake-a54d96b72279e4426ca21190951b2c0c5401cb74.tar.gz CMake-a54d96b72279e4426ca21190951b2c0c5401cb74.tar.bz2 |
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.
Diffstat (limited to 'Source/cmAlgorithms.h')
-rw-r--r-- | Source/cmAlgorithms.h | 4 |
1 files 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 <typename ForwardIterator> ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last) { using Value = typename std::iterator_traits<ForwardIterator>::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 { |