Commit 747544d7a04559cbe1a62987f396d2cc9aaaa7f1

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