Opened 7 years ago
Closed 7 years ago
#11887 closed Bugs (fixed)
BOOST_TEST(3u == (std::max)(0u, 3u)) fails
| Reported by: | Benedek Thaler | Owned by: | Raffi Enficiaud |
|---|---|---|---|
| Milestone: | Boost 1.61.0 | Component: | test |
| Version: | Boost 1.60.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
Given the following program:
#include <algorithm>
#define BOOST_TEST_MODULE sandbox
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE(sandbox)
{
BOOST_TEST(3u == ((std::max)(0u, 3u)));
}
The check fails with:
check 3u == ((std::max)(0u, 3u)) has failed [3 != 7095312]
(The large number on the right hand side is not specific, depends on the program)
Change History (7)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
From your post on the ML and the trace, I see that the right operand is bound to unsigned int & while it should be unsigned int.
comment:3 by , 7 years ago
Would you please try running your example against branch fix/handling-rvalue-erasure?
Thanks
comment:4 by , 7 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:6 by , 7 years ago
| Milestone: | To Be Determined → Boost 1.61.0 |
|---|
Very good, thank you for the feedback!
comment:7 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Commits
- fd11b12dd6675a8d86ba54a21bce3f5f16f8c77e
- 20e50a6d9444e5bb9bccdf51705b4e463c024853
Merged in master:
- 2b918d0bd56cd2add28a1e35c6a2d0fd8c60cf90
Note:
See TracTickets
for help on using tickets.

Would you please provide the compilation line? especially, I would like to know it you are using C++11.