Skip to content

Conversation

@random-zebra
Copy link

Backport of bitcoin#16730, fixing the following clang warning:

./serialize.h:631:44: warning: loop variable 'elem' is always a copy because the range of type 'const
      std::vector<bool, std::allocator<bool> >' does not return a reference [-Wrange-loop-analysis]
        for (const typename V::value_type& elem : v) {
                                           ^
./serialize.h:484:77: note: in instantiation of function template specialization
      'VectorFormatter<DefaultFormatter>::Ser<CHashWriter, std::vector<bool, std::allocator<bool> > >'
      requested here
    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
                                                                            ^
./serialize.h:806:7: note: in instantiation of function template specialization
      'Wrapper<VectorFormatter<DefaultFormatter>, const std::vector<bool, std::allocator<bool> >
      &>::Serialize<CHashWriter>' requested here
    a.Serialize(os);
      ^
./serialize.h:956:5: note: in instantiation of function template specialization 'Serialize<CHashWriter,
      Wrapper<VectorFormatter<DefaultFormatter>, const std::vector<bool, std::allocator<bool> > &> >'
      requested here
    Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
    ^
./serialize.h:962:5: note: in instantiation of function template specialization
      'Serialize_impl<CHashWriter, bool, std::allocator<bool>, bool>' requested here
    Serialize_impl(os, v, T());
    ^
./hash.h:247:11: note: in instantiation of function template specialization 'Serialize<CHashWriter, bool,
      std::allocator<bool> >' requested here
        ::Serialize(*this, obj);
          ^
./hash.h:292:8: note: in instantiation of function template specialization
      'CHashWriter::operator<<<std::vector<bool, std::allocator<bool> > >' requested here
    ss << obj;
       ^
init.cpp:1504:39: note: in instantiation of function template specialization
      'SerializeHash<std::vector<bool, std::allocator<bool> > >' requested here
        const uint256 asmap_version = SerializeHash(asmap);

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good finding, utACK bbd14ce

@furszy furszy merged commit 2b0e8fa into PIVX-Project:master Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants