diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23386cd4..4cf32cbe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -62,7 +62,8 @@ jobs: cli11.std: 11 Windowslatest: vmImage: 'windows-2019' - cli11.std: 17 + cli11.std: 20 + cli11.options: -DCMAKE_CXX_FLAG="/std:c++latest" pool: vmImage: $(vmImage) steps: @@ -113,6 +114,10 @@ jobs: containerImage: silkeh/clang:8 cli11.std: 17 cli11.options: -DCLI11_FORCE_LIBCXX=ON + clang10_20: + containerImage: helics/buildenv:clang10-builder + cli11.std: 20 + cli11.options: -DCLI11_FORCE_LIBCXX=ON -DCMAKE_CXX_FLAGS=-std=c++20 container: $[ variables['containerImage'] ] steps: - template: .ci/azure-cmake.yml diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 98f0b03f..30810b07 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -3055,7 +3055,18 @@ inline std::string help(const App *app, const Error &e) { namespace detail { /// This class is simply to allow tests access to App's protected functions struct AppFriend { +#ifdef CLI11_CPP14 + /// Wrap _parse_short, perfectly forward arguments and return + template static decltype(auto) parse_arg(App *app, Args &&... args) { + return app->_parse_arg(std::forward(args)...); + } + + /// Wrap _parse_subcommand, perfectly forward arguments and return + template static decltype(auto) parse_subcommand(App *app, Args &&... args) { + return app->_parse_subcommand(std::forward(args)...); + } +#else /// Wrap _parse_short, perfectly forward arguments and return template static auto parse_arg(App *app, Args &&... args) -> @@ -3069,6 +3080,7 @@ struct AppFriend { typename std::result_of::type { return app->_parse_subcommand(std::forward(args)...); } +#endif /// Wrap the fallthrough parent function to make sure that is working correctly static App *get_fallthrough_parent(App *app) { return app->_get_fallthrough_parent(); } };