Ticket #2134 (closed Bugs: fixed)

Opened 9 years ago

Last modified 7 years ago

Namespace conflict in implementation of Boost.Integer

Reported by: dlwalker Owned by: dlwalker
Milestone: Boost 1.36.0 Component: integer
Version: Boost Development Trunk Severity: Problem
Keywords: integer namespace integer_traits Cc: jwulp@…, dwalker07@…


This is based off the thread starting at <>.

In "[source:trunk/boost/integer.hpp@47408 boost/integer.hpp]", class templates in the boost::detail namespace refer to an unadorned integer_traits template. The template referenced is meant to be boost::integer_traits in "[source:trunk/boost/boost/integer_traits.hpp@32576 boost/integer_traits.hpp]". However, a boost::detail::integer_traits template exists in "[source:trunk/boost/boost/detail/numeric_traits.hpp@24446 boost/detail/numeric_traits.hpp]". This latter template gets priority as the choice of what the unadorned integer_traits mention refers to, which was not intended. The problem only manifests when "boost/detail/numeric_traits.hpp" gets #included, directly or indirectly, before "boost/integer.hpp", but doesn't manifest if "boost/integer.hpp" is #included first (which may be a ODR violation).

Thanks to Jeroen van der Wulp for initially reporting this and providing a potential patch.


boost-integer.hpp.diff Download (3.1 KB) - added by dlwalker 9 years ago.
Potential patch provided by Jeroen van der Wulp

Change History

Changed 9 years ago by dlwalker

Potential patch provided by Jeroen van der Wulp

comment:1 Changed 9 years ago by dlwalker

  • Cc dwalker07@… added

comment:2 Changed 9 years ago by dlwalker

  • Status changed from new to closed
  • Resolution set to fixed

(In [47742]) Resolved namespace conflict from unadorned call, which fixes #2134

comment:3 Changed 7 years ago by anonymous

  • Status changed from closed to reopened
  • Resolution fixed deleted

Recent Trunk reversion has broken this - or rather it hasn't because Boost.Integer is no longer hiding it's details in the detail namespace - and it should.

comment:4 Changed 7 years ago by johnmaddock

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [57884]) Tidied up namespace usage, fixes #2134.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.