Opened 3 years ago

Closed 2 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:


Given the following program:

#include <algorithm>

#define BOOST_TEST_MODULE sandbox
#include <boost/test/included/unit_test.hpp>

  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)

Attachments (0)

Change History (7)

comment:1 Changed 3 years ago by Raffi Enficiaud

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

comment:2 Changed 3 years ago by Raffi Enficiaud

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 Changed 3 years ago by Raffi Enficiaud

Would you please try running your example against branch fix/handling-rvalue-erasure?


comment:4 Changed 3 years ago by Raffi Enficiaud

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

comment:5 Changed 3 years ago by Benedek Thaler

Works for me after applying fix/handling-rvalue-erasure

comment:6 Changed 3 years ago by Raffi Enficiaud

Milestone: To Be DeterminedBoost 1.61.0

Very good, thank you for the feedback!

comment:7 Changed 2 years ago by Raffi Enficiaud

Resolution: fixed
Status: assignedclosed


  • fd11b12dd6675a8d86ba54a21bce3f5f16f8c77e
  • 20e50a6d9444e5bb9bccdf51705b4e463c024853

Merged in master:

  • 2b918d0bd56cd2add28a1e35c6a2d0fd8c60cf90

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Raffi Enficiaud.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.