Modify

Ticket #11887 (closed Bugs: fixed)

Opened 15 months ago

Last modified 14 months ago

BOOST_TEST(3u == (std::max)(0u, 3u)) fails

Reported by: Benedek Thaler Owned by: renficiaud
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)

Attachments

Change History

comment:1 Changed 15 months ago by renficiaud

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

comment:2 Changed 15 months ago by renficiaud

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 15 months ago by renficiaud

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

Thanks

comment:4 Changed 15 months ago by renficiaud

  • Owner changed from rogeeff to renficiaud
  • Status changed from new to assigned

comment:5 Changed 15 months ago by Benedek Thaler

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

comment:6 Changed 15 months ago by renficiaud

  • Milestone changed from To Be Determined to Boost 1.61.0

Very good, thank you for the feedback!

comment:7 Changed 14 months ago by renficiaud

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

Commits

  • fd11b12dd6675a8d86ba54a21bce3f5f16f8c77e
  • 20e50a6d9444e5bb9bccdf51705b4e463c024853

Merged in master:

  • 2b918d0bd56cd2add28a1e35c6a2d0fd8c60cf90
View

Add a comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.