summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-03-07 13:34:43 +0200
committerBrad King <brad.king@kitware.com>2020-03-09 09:21:25 -0400
commita54d96b72279e4426ca21190951b2c0c5401cb74 (patch)
tree38e919525c1e823bf049ce1fc6b28a97bb253992
parentd1cb554c99c73e1486fbf4e09125337a7c0e9ea3 (diff)
downloadcmake-a54d96b72279e4426ca21190951b2c0c5401cb74.tar.gz
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.
-rw-r--r--Source/cmAlgorithms.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 19da2a08ee..c0ac5512a3 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
{