Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#6169 closed Bugs (worksforme)

integer.hpp fails to produce compiler error for large number of bits

Reported by: cmoore@… Owned by: viboes
Milestone: To Be Determined Component: integer
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

According to the documentation, when using the uint_t<Bits> template, a compile time error should be produced when asking for more bits that a native type can provide. Actual behavior compiles successfully.

std::numeric_limits<boost::uint_t<65>::least>::digits 
//65 produces 64 instead of a compile error.

std::numeric_limits<boost::uint_t<66>::least>::digits
//66 and larger numbers produce 7 instead of a compile error.

compiler: apple gcc-4.2 (xcode 4.2), macports gcc-4.6

Attachments (2)

test-example.cpp​ (848 bytes ) - added by Chris Moore <cmoore@…> 11 years ago.
Sample program exposing the issue.
patch-against-1.48.0.patch​ (3.8 KB ) - added by Chris Moore <cmoore@…> 11 years ago.
Patch against 1.48.0 that fixes the example for me.

Download all attachments as: .zip

Change History (5)

by Chris Moore <cmoore@…>, 11 years ago

Attachment: test-example.cpp​ added

Sample program exposing the issue.

by Chris Moore <cmoore@…>, 11 years ago

Attachment: patch-against-1.48.0.patch​ added

Patch against 1.48.0 that fixes the example for me.

comment:1 by viboes, 8 years ago

Owner: changed from Daryle Walker to viboes
Status: new → assigned

comment:2 by viboes, 8 years ago

Resolution: → worksforme
Status: assigned → closed

The implementation has changed completely.

I have tested and it works for me now 1.57.

Note: See TracTickets for help on using tickets.