-
Notifications
You must be signed in to change notification settings - Fork 222
#5398 - Workarounds to let OpenStudio build with recent clang #5400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Clang has a new warning that requires a template argument list after using the template keyword. See llvm/llvm-project#94194 for the upstream clang changes ``` /Users/julien/Software/Others/OpenStudio3/src/nano/nano_signal_slot.hpp:40:41: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] 40 | Observer::insert(Delegate::template bind(instance), this); | ^ /Users/julien/Software/Others/OpenStudio3/src/nano/nano_signal_slot.hpp:74:41: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] 74 | Observer::remove(Delegate::template bind(instance), this); | ^ 2 errors generated. ```
…e not specifying types.
```
/Users/julien/.conan2/p/b/boost1b0853b234640/p/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'lock_access_mode' [-Wenum-constexpr-conversion]
73 | typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
| ^
/Users/julien/.conan2/p/b/boost1b0853b234640/p/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
24 | # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
```
```
In file included from /Users/julien/.conan2/p/b/boost1b0853b234640/p/include/boost/numeric/ublas/traits.hpp:21:
/Users/julien/.conan2/p/b/boost1b0853b234640/p/include/boost/numeric/ublas/detail/iterator.hpp:204:21: error: 'iterator<boost::numeric::ublas::dense_random_access_iterator_tag, double>' is deprecated [-Werror,-Wdeprecated-declarations]
204 | public std::iterator<IC, T> {
| ^
/Users/julien/.conan2/p/b/boost1b0853b234640/p/include/boost/numeric/ublas/vector_expression.hpp:1333:20: note: in instantiation of template class 'boost::numeric::ublas::random_access_iterator_base<boost::numeric::ublas::dense_random_access_iterator_tag, boost::numeric::ublas::vector_binary_scalar2<boost::numeric::ublas::vector<double>, const double, boost::numeric::ublas::scalar_multiplies<double, double>>::const_iterator, double>' requested here
1333 | public iterator_base_traits<typename E1::const_iterator::iterator_category>::template
```
| #ifndef CPPRESTSDK_CHAR_TRAITS_WORKAROUND | ||
| #define CPPRESTSDK_CHAR_TRAITS_WORKAROUND | ||
|
|
||
| // https://github.com/microsoft/cpprestsdk/issues/1812 | ||
|
|
||
| #include <cstdint> | ||
| #include <cstring> | ||
| #include <string> | ||
|
|
||
| namespace std { | ||
| template <> | ||
| struct char_traits<uint8_t> | ||
| { | ||
| using char_type = uint8_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reimplementing std::char_traits<uint8_t>...
| #if __APPLE__ | ||
| # include "../../dependencies/cpprestsdk_char_traits_workaround.hpp" | ||
| #endif | ||
| #define _TURN_OFF_PLATFORM_STRING // cpprestsdk has an ugly macro U() that makes fmt break... | ||
| #include <cpprest/http_listener.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I include it where needed..
| #if __APPLE__ | ||
| # include "../../../dependencies/cpprestsdk_char_traits_workaround.hpp" | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
| template <typename L> | ||
| void disconnect(L* instance) { | ||
| Observer::remove(Delegate::template bind(instance), this); | ||
| Observer::remove(Delegate::bind(instance), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang has a new warning -Wmissing-template-arg-list-after-template-kw that requires a template argument list after using the template keyword.
See llvm/llvm-project#94194 for the upstream clang changes.
I'm using CTAD.
CMakeLists.txt
Outdated
| # TODO: workaround for #5398, remove when updating boost | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion -Wno-deprecated-declarations") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New flags for boost 1.79.0
|
CI Results for 2956fd9:
|
Pull request overview
Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.