Skip to content

Commit 747544d

Browse files
authored
try clang 10 (#459)
* try clang 10 * use helics-builder clang 10 image * try new image * try again * try different flag addition * try adding cpp20 to visual studio check * try with the latest flag enabled for visual studio 2019 * try the correct c++ flag * remove use of std::result_of * format files
1 parent c439562 commit 747544d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
cli11.std: 11
6363
Windowslatest:
6464
vmImage: 'windows-2019'
65-
cli11.std: 17
65+
cli11.std: 20
66+
cli11.options: -DCMAKE_CXX_FLAG="/std:c++latest"
6667
pool:
6768
vmImage: $(vmImage)
6869
steps:
@@ -113,6 +114,10 @@ jobs:
113114
containerImage: silkeh/clang:8
114115
cli11.std: 17
115116
cli11.options: -DCLI11_FORCE_LIBCXX=ON
117+
clang10_20:
118+
containerImage: helics/buildenv:clang10-builder
119+
cli11.std: 20
120+
cli11.options: -DCLI11_FORCE_LIBCXX=ON -DCMAKE_CXX_FLAGS=-std=c++20
116121
container: $[ variables['containerImage'] ]
117122
steps:
118123
- template: .ci/azure-cmake.yml

include/CLI/App.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,18 @@ inline std::string help(const App *app, const Error &e) {
30863086
namespace detail {
30873087
/// This class is simply to allow tests access to App's protected functions
30883088
struct AppFriend {
3089+
#ifdef CLI11_CPP14
3090+
3091+
/// Wrap _parse_short, perfectly forward arguments and return
3092+
template <typename... Args> static decltype(auto) parse_arg(App *app, Args &&... args) {
3093+
return app->_parse_arg(std::forward<Args>(args)...);
3094+
}
30893095

3096+
/// Wrap _parse_subcommand, perfectly forward arguments and return
3097+
template <typename... Args> static decltype(auto) parse_subcommand(App *app, Args &&... args) {
3098+
return app->_parse_subcommand(std::forward<Args>(args)...);
3099+
}
3100+
#else
30903101
/// Wrap _parse_short, perfectly forward arguments and return
30913102
template <typename... Args>
30923103
static auto parse_arg(App *app, Args &&... args) ->
@@ -3100,6 +3111,7 @@ struct AppFriend {
31003111
typename std::result_of<decltype (&App::_parse_subcommand)(App, Args...)>::type {
31013112
return app->_parse_subcommand(std::forward<Args>(args)...);
31023113
}
3114+
#endif
31033115
/// Wrap the fallthrough parent function to make sure that is working correctly
31043116
static App *get_fallthrough_parent(App *app) { return app->_get_fallthrough_parent(); }
31053117
};

0 commit comments

Comments
 (0)