Commit 747544d7a04559cbe1a62987f396d2cc9aaaa7f1
Committed by
GitHub
1 parent
c439562a
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
Showing
2 changed files
with
18 additions
and
1 deletions
azure-pipelines.yml
| ... | ... | @@ -62,7 +62,8 @@ jobs: |
| 62 | 62 | cli11.std: 11 |
| 63 | 63 | Windowslatest: |
| 64 | 64 | vmImage: 'windows-2019' |
| 65 | - cli11.std: 17 | |
| 65 | + cli11.std: 20 | |
| 66 | + cli11.options: -DCMAKE_CXX_FLAG="/std:c++latest" | |
| 66 | 67 | pool: |
| 67 | 68 | vmImage: $(vmImage) |
| 68 | 69 | steps: |
| ... | ... | @@ -113,6 +114,10 @@ jobs: |
| 113 | 114 | containerImage: silkeh/clang:8 |
| 114 | 115 | cli11.std: 17 |
| 115 | 116 | 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 | |
| 116 | 121 | container: $[ variables['containerImage'] ] |
| 117 | 122 | steps: |
| 118 | 123 | - template: .ci/azure-cmake.yml | ... | ... |
include/CLI/App.hpp
| ... | ... | @@ -3086,7 +3086,18 @@ inline std::string help(const App *app, const Error &e) { |
| 3086 | 3086 | namespace detail { |
| 3087 | 3087 | /// This class is simply to allow tests access to App's protected functions |
| 3088 | 3088 | 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 | + } | |
| 3089 | 3095 | |
| 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 | |
| 3090 | 3101 | /// Wrap _parse_short, perfectly forward arguments and return |
| 3091 | 3102 | template <typename... Args> |
| 3092 | 3103 | static auto parse_arg(App *app, Args &&... args) -> |
| ... | ... | @@ -3100,6 +3111,7 @@ struct AppFriend { |
| 3100 | 3111 | typename std::result_of<decltype (&App::_parse_subcommand)(App, Args...)>::type { |
| 3101 | 3112 | return app->_parse_subcommand(std::forward<Args>(args)...); |
| 3102 | 3113 | } |
| 3114 | +#endif | |
| 3103 | 3115 | /// Wrap the fallthrough parent function to make sure that is working correctly |
| 3104 | 3116 | static App *get_fallthrough_parent(App *app) { return app->_get_fallthrough_parent(); } |
| 3105 | 3117 | }; | ... | ... |