When compiling with -Wsystem-headers, I noticed:

/usr/include/c++/4.5/bits/hashtable.h:179:30: warning: 'std::_Hashtable<const
void*, const void*, std::allocator<const void*>, std::_Identity<const void*>,
..., ..., std::__detail::_Mod_range_hashing,
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy,
false, true, true>::_M_rehash_policy' will be initialized after [-Wreorder]

/usr/include/c++/4.5/bits/hashtable.h:176:30: warning:   'std::_Hashtable<const
void*, const void*, std::allocator<const void*>, std::_Identity<const void*>,
..., ..., std::__detail::_Mod_range_hashing,
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy,
false, true, true>::_Node** std::_Hashtable<const void*, const void*,
std::allocator<const void*>, std::_Identity<const void*>, ..., ...,
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash,
std::__detail::_Prime_rehash_policy, false, true, true>::_M_buckets'
[-Wreorder]

/usr/include/c++/4.5/bits/hashtable.h:646:5: warning:   when initialized here
[-Wreorder]


Moving the initialization of _M_buckets to before _M_bucket_count should fix
it. This is actually the *only* extra warning I got when compiling a large C++
codebase with -Wsystem-headers, which is great!


-- 
           Summary: Wreorder warning in bits/hashtable.h
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: foom at fuhm dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45060

Reply via email to