Skip to content
Snippets Groups Projects
Commit beecf15a authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'clang.AthenaMonitoring-20170911' into 'master'

AthenaMonitoring: Fix compilation with clang 4.0.1.

See merge request !4585
parents 3b6b0c92 456b8296
No related branches found
No related tags found
No related merge requests found
...@@ -119,8 +119,11 @@ namespace Monitored { ...@@ -119,8 +119,11 @@ namespace Monitored {
using value_type = typename detail::get_value_type<T>::value_type; using value_type = typename detail::get_value_type<T>::value_type;
/// @brief . \if empty doc string required due to doxygen bug 787131 \endif /// @brief . \if empty doc string required due to doxygen bug 787131 \endif
friend MonitoredObjectsCollection<T> declare<T>(std::string name, const T& collection, // With a non-template friend declaration, clang 4.0.1
std::function<double(const value_type&)> converterToDouble); // fails to match the friend.
template <class U>
friend MonitoredObjectsCollection<U> declare(std::string name, const U& collection,
std::function<double(const typename MonitoredObjectsCollection<U>::value_type&)> converterToDouble);
MonitoredObjectsCollection(MonitoredObjectsCollection&&) = default; MonitoredObjectsCollection(MonitoredObjectsCollection&&) = default;
......
...@@ -40,6 +40,12 @@ namespace Monitored { ...@@ -40,6 +40,12 @@ namespace Monitored {
operator T() const { return m_value; } operator T() const { return m_value; }
operator T&() { return m_value; } operator T&() { return m_value; }
// Needed to work around an apparent bug in clang 4.0.1.
// Without these declarations, clang rejects `--SCALAR'
// (but ++SCALAR, SCALAR++, and SCALAR-- are all accepted!).
T operator--() { return --m_value; }
T operator--(int) { return m_value--; }
const std::vector<double> getVectorRepresentation() const override { return { double(m_value) }; } const std::vector<double> getVectorRepresentation() const override { return { double(m_value) }; }
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment