Repository navigation
Fix the build with C++20 and C++23 - #549
Merged
Merged
Conversation
C++20 deprecates the implicit capture of this by [=], and GCC warns about it, so capture this explicitly in slog's async_log_service, and use a local pointer in the mDNS service advertiser, as the service discovery implementation already does. C++23 treats a returned local variable as an rvalue, which cannot bind to the non-const copy constructor of Catch's OptBuilder, so take a const reference instead. Signed-off-by: Gareth Sylvester-Bradley <garethsb@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares for a C++23 CI job, without adding one.
Building with
CMAKE_CXX_STANDARD=23on ubuntu-26.04 (GCC 15) failed in two ways:OptBuilder, socatch.hppdid not compile. This PR makes the copy constructor take a const reference.thisby[=], and GCC warns about it, which would fail a build with warnings as errors. This PR capturesthisexplicitly in slog'sasync_log_service, and uses a local pointer in the mDNS service advertiser, as the service discovery implementation already does. Writing[=, this]instead would warn before C++20.With this change, a throwaway run on my fork built at C++23 on ubuntu-26.04, with and without Conan, passed all the unit tests, and passed the AMWA test suites (https://github.com/garethsb/nmos-cpp/actions/runs/44361063182). The mDNS test failed there the same way as on ubuntu-24.04 on master.
The non-Conan job in that run also showed two implicit
thiswarnings in cpprestsdk'sws_client.cpp, which cpprest-lts/cpprestsdk#69 fixes.Co-authored-by: Gareth's 🤖 buddy