Upgrade to C++20 (#4239)

* Use explicit this capture required by C++20
* Use C++20 span
* Replace wpi::numbers with std::numbers
* Fix C++20 clang-tidy warning false positive in fmt
* Remove ciso646 include since C++20 removed that header
* Fix global-buffer-overflow asan warnings in ntcore tests
* Add DIOSetProxy constructor to HAL

* Upgrade MSVC compiler to 2022
* Bump native-utils to 2023.2.7 (changes to std=c++20)

Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
This commit is contained in:
Tyler Veness
2022-10-15 16:33:14 -07:00
committed by GitHub
parent 396143004c
commit fbdc810887
355 changed files with 1659 additions and 2918 deletions

View File

@@ -6,10 +6,10 @@
#include <stdint.h>
#include <span>
#include <vector>
#include <wpi/raw_ostream.h>
#include <wpi/span.h>
#include "gmock/gmock.h"
#include "net3/WireConnection3.h"
@@ -24,7 +24,7 @@ class MockWireConnection3 : public WireConnection3 {
Writer Send() override { return {m_os, *this}; }
MOCK_METHOD(void, Data, (wpi::span<const uint8_t> data));
MOCK_METHOD(void, Data, (std::span<const uint8_t> data));
MOCK_METHOD(void, Flush, (), (override));

View File

@@ -42,9 +42,9 @@ class MockMessageHandler3 : public net3::MessageHandler3 {
MOCK_METHOD2(FlagsUpdate, void(unsigned int id, unsigned int flags));
MOCK_METHOD1(EntryDelete, void(unsigned int id));
MOCK_METHOD3(ExecuteRpc, void(unsigned int id, unsigned int uid,
wpi::span<const uint8_t> params));
std::span<const uint8_t> params));
MOCK_METHOD3(RpcResponse, void(unsigned int id, unsigned int uid,
wpi::span<const uint8_t> result));
std::span<const uint8_t> result));
};
class WireDecoder3Test : public ::testing::Test {
@@ -52,7 +52,7 @@ class WireDecoder3Test : public ::testing::Test {
StrictMock<MockMessageHandler3> handler;
net3::WireDecoder3 decoder{handler};
void DecodeComplete(wpi::span<const uint8_t> in) {
void DecodeComplete(std::span<const uint8_t> in) {
decoder.Execute(&in);
EXPECT_TRUE(in.empty());
ASSERT_EQ(decoder.GetError(), "");