Opened 7 years ago

Closed 7 years ago

#11623 closed Bugs (fixed)

Clang rejects some simple BOOST_TEST() statements

Reported by: Tony Lewis <tonyelewis@…> Owned by: Raffi Enficiaud
Milestone: Boost 1.60.0 Component: test
Version: Boost 1.59.0 Severity: Problem
Keywords: BOOST_TEST, double, float, clang, mutable Cc:

Description

Thanks again for the new BOOST_TEST() tool, which looks very useful.

Unfortunately, I'm unable to compile the following under clang++ (with or without -std=c++11) :

#define BOOST_TEST_MODULE comp_doub_mod

#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE( comp_doubs ) {
        const double num { 1.0 };
        BOOST_TEST( num == 1.0 );
        // BOOST_TEST( 1.0 == num );
}

This also fails if I swap to the commented-out BOOST_TEST() line.

The core of the error message is:

[...]/boost/test/tools/floating_point_comparison.hpp:259:25: error: 'mutable' cannot be applied to references
    mutable FPT         m_tested_rel_diff;
                        ^

I'll attach the full compiler error output.

Attachments (1)

clang_compile_errors.err (3.7 KB ) - added by Tony Lewis <tonyelewis@…> 7 years ago.
clang++ compilation errors

Download all attachments as: .zip

Change History (8)

by Tony Lewis <tonyelewis@…>, 7 years ago

Attachment: clang_compile_errors.err added

clang++ compilation errors

comment:1 by Gennadiy Rozental, 7 years ago

Resolution: fixed
Status: newclosed

thx for the report

comment:2 by Tony Lewis <tonyelewis@…>, 7 years ago

Thanks for the successful fix in the develop branch. Will this make it into 1.60.0?

comment:3 by Raffi Enficiaud, 7 years ago

Resolution: fixed
Status: closedreopened

Assigning to keep track of the change, will close once in master

comment:4 by Raffi Enficiaud, 7 years ago

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

comment:5 by Raffi Enficiaud, 7 years ago

Status: newassigned

comment:6 by Raffi Enficiaud, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0

comment:7 by Raffi Enficiaud, 7 years ago

Resolution: fixed
Status: assignedclosed

merged to master

Note: See TracTickets for help on using tickets.