Attempt to fix clang CI error

This commit is contained in:
John Wellbelove 2022-09-11 15:29:51 +01:00
parent ceeee5686d
commit 34491c4ccb
8 changed files with 36 additions and 143 deletions

View File

@ -1,94 +1,18 @@
name: clang
on:
push:
branches: [ master ]
branches: [ hotfix/attempt-to-fix-clang-ci-error ]
pull_request:
branches: [ master ]
jobs:
build-clang-9-linux-stl:
name: Clang-9 Linux - STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
clang --version
make
- name: Run tests
run: ./test/etl_tests
build-clang-9-linux-no-stl:
name: Clang-9 Linux - No STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -DBUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
gcc --version
cmake -D BUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
clang --version
make
- name: Run tests
run: ./test/etl_tests
build-clang-9-linux-stl-force-cpp03:
name: Clang-9 Linux - STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y "clang-9" "lldb-9" "lld-9" "clang-format-9"
export CC=clang-9
export CXX=clang++-9
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=ON ./
clang --version
make
- name: Run tests
run: ./test/etl_tests
build-clang-10-osx-stl:
name: Clang-10 OSX - STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15]
os: [macos-11]
steps:
- uses: actions/checkout@v2
@ -106,49 +30,3 @@ jobs:
- name: Run tests
run: ./test/etl_tests
build-clang-10-osx-no-stl:
name: Clang-10 OSX - No STL
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15]
steps:
- uses: actions/checkout@v2
- name: Build
run: |
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -D BUILD_TESTS=ON -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ./
clang --version
make
- name: Run tests
run: ./test/etl_tests
build-clang-10-osx-stl-force-cpp03:
name: Clang-10 OSX - STL - Force C++03
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15]
steps:
- uses: actions/checkout@v2
- name: Build
run: |
export CC=clang
export CXX=clang++
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
git fetch --tags
cmake -D BUILD_TESTS=ON -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=ON ./
clang --version
make
- name: Run tests
run: ./test/etl_tests

View File

@ -31,6 +31,7 @@ SOFTWARE.
#ifndef ETL_PLATFORM_INCLUDED
#define ETL_PLATFORM_INCLUDED
#include <stddef.h>
#include <stdint.h>
#include <limits.h>

View File

@ -158,13 +158,13 @@ namespace etl
value_type key_value_pair;
};
friend static bool operator ==(const node_t& lhs, const node_t& rhs)
friend bool operator ==(const node_t& lhs, const node_t& rhs)
{
return (lhs.key_value_pair.first == rhs.key_value_pair.first) &&
(lhs.key_value_pair.second == rhs.key_value_pair.second);
}
friend static bool operator !=(const node_t& lhs, const node_t& rhs)
friend bool operator !=(const node_t& lhs, const node_t& rhs)
{
return !(lhs == rhs);
}

View File

@ -44,12 +44,16 @@ namespace
//*************************************************************************
TEST(test_murmur3_32_constructor)
{
std::string data("123456789");
std::aligned_storage_t<sizeof(char), std::alignment_of_v<uint32_t>> storage[10];
std::string data("123456789");
uint32_t hash = etl::murmur3<uint32_t>(data.begin(), data.end());
char* begin = (char*)&storage[0];
strcpy(begin, data.c_str());
uint32_t hash = etl::murmur3<uint32_t>(begin, begin + data.size());
uint32_t compare;
MurmurHash3_x86_32(data.c_str(), data.size(), 0, &compare);
MurmurHash3_x86_32(begin, data.size(), 0, &compare);
CHECK_EQUAL(compare, hash);
}
@ -57,8 +61,12 @@ namespace
//*************************************************************************
TEST(test_murmur3_32_add_values)
{
std::aligned_storage_t<sizeof(char), std::alignment_of_v<uint32_t>> storage[10];
std::string data("123456789");
char* begin = (char*)&storage[0];
strcpy(begin, data.c_str());
etl::murmur3<uint32_t> murmur3_32_calculator;
for (size_t i = 0UL; i < data.size(); ++i)
@ -69,7 +77,7 @@ namespace
uint32_t hash = murmur3_32_calculator;
uint32_t compare;
MurmurHash3_x86_32(data.c_str(), data.size(), 0, &compare);
MurmurHash3_x86_32(begin, data.size(), 0, &compare);
CHECK_EQUAL(compare, hash);
}
@ -77,8 +85,12 @@ namespace
//*************************************************************************
TEST(test_murmur3_32_add_range)
{
std::aligned_storage_t<sizeof(char), std::alignment_of_v<uint32_t>> storage[10];
std::string data("123456789");
char* begin = (char*)&storage[0];
strcpy(begin, data.c_str());
etl::murmur3<uint32_t> murmur3_32_calculator;
murmur3_32_calculator.add(data.begin(), data.end());
@ -86,7 +98,7 @@ namespace
uint32_t hash = murmur3_32_calculator.value();
uint32_t compare;
MurmurHash3_x86_32(data.c_str(), data.size(), 0, &compare);
MurmurHash3_x86_32(begin, data.size(), 0, &compare);
CHECK_EQUAL(compare, hash);
}

View File

@ -419,7 +419,8 @@ namespace
bool isEqual = std::equal(data.begin(),
data.end(),
other_data.begin());
other_data.begin(),
std::equal_to<DataNDC::value_type>());
CHECK(isEqual);
}
@ -435,7 +436,7 @@ namespace
idata2 = idata1;
bool isEqual = std::equal(data1.begin(),
bool isEqual = etl::equal(data1.begin(),
data1.end(),
data2.begin());
@ -452,7 +453,7 @@ namespace
other_data = other_data;
#include "etl/private/diagnostic_pop.h"
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());

View File

@ -37,6 +37,7 @@ SOFTWARE.
#include <vector>
#include <numeric>
#include <functional>
#include <unordered_map>
#include "data.h"
@ -338,7 +339,7 @@ namespace
other_data = data;
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());
@ -356,7 +357,7 @@ namespace
idata2 = idata1;
bool isEqual = std::equal(data1.begin(),
bool isEqual = etl::equal(data1.begin(),
data1.end(),
data2.begin());
@ -374,7 +375,7 @@ namespace
#include "etl/private/diagnostic_pop.h"
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());

View File

@ -283,7 +283,7 @@ namespace
other_data = data;
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());
@ -301,7 +301,7 @@ namespace
idata2 = idata1;
bool isEqual = std::equal(data1.begin(),
bool isEqual = etl::equal(data1.begin(),
data1.end(),
data2.begin());
@ -318,7 +318,7 @@ namespace
other_data = other_data;
#include "etl/private/diagnostic_pop.h"
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());

View File

@ -267,7 +267,7 @@ namespace
other_data = data;
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());
@ -285,7 +285,7 @@ namespace
idata2 = idata1;
bool isEqual = std::equal(data1.begin(),
bool isEqual = etl::equal(data1.begin(),
data1.end(),
data2.begin());
@ -302,7 +302,7 @@ namespace
other_data = other_data;
#include "etl/private/diagnostic_pop.h"
bool isEqual = std::equal(data.begin(),
bool isEqual = etl::equal(data.begin(),
data.end(),
other_data.begin());