Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5557 closed Bugs (fixed)

lexical_cast<int>("+2") failure

Reported by: Ralf W. Grosse-Kunstleve Owned by: Antony Polukhin
Milestone: To Be Determined Component: lexical_cast
Version: Boost Development Trunk Severity: Regression
Keywords: Cc:

Description

boost svn trunk revision 72056 breaks

lexical_cast<int>("+2")

on all platforms we have (g++ 3.2 through 4.6, Visual C++ 8.0 through 10.0, Intel C++ 9 through 11).

I will attach a small reproducer. With g++ 4.4.4 I get:

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_lexical_cast> >'

what(): bad lexical cast: source type value could not be interpreted as target

Attachments (1)

lexical_cast_72056_bug.cpp (142 bytes ) - added by Ralf W. Grosse-Kunstleve 11 years ago.
small reproducer

Download all attachments as: .zip

Change History (5)

by Ralf W. Grosse-Kunstleve, 11 years ago

Attachment: lexical_cast_72056_bug.cpp added

small reproducer

comment:1 by Antony Polukhin, 11 years ago

Status: newassigned

comment:2 by Antony Polukhin, 11 years ago

Resolution: fixed
Status: assignedclosed

(In [72071]) Fixes #5557. Adds tests on #5557

comment:3 by Antony Polukhin, 11 years ago

Great thanks.
If you have some more test cases, that are not included in lexical_cast test suite, please send/post them.

comment:4 by Ralf W. Grosse-Kunstleve, 11 years ago

Thanks for the quick fix! There are no errors anymore in out nightly multi-platform tests.

Note: See TracTickets for help on using tickets.