boost 1.33.0: Bug in property

boost_1_33_0/boost/pending/property.hpp has template <class Tag, class T, class Base = no_property> struct property : public Base { typedef Base next_type; typedef Tag tag_type; typedef T value_type; property() { } property(const T& v) : m_value(v) { } property(const T& v, const Base& b) : Base(b), m_value(v) { } // copy constructor and assignment operator will be generated by compiler T m_value; }; The bug here is that the empty ctor does not initialize m_value which leads to gcc 4.0.1 warning about m_value being used uninitialized. As our automatic build system rejects packages with such warnings I had to fix it :) This is the patch I'm using: --- boost/pending/property.hpp +++ boost/pending/property.hpp @@ -22,7 +22,7 @@ typedef Base next_type; typedef Tag tag_type; typedef T value_type; - property() { } + property() : m_value() { } property(const T& v) : m_value(v) { } property(const T& v, const Base& b) : Base(b), m_value(v) { } // copy constructor and assignment operator will be generated by compiler Philipp -- Philipp Thomas <pth@suse.de> Research & Development SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuremberg, Germany
participants (1)
-
Philipp Thomas