Skip to content

Broken backward compability: libBoost 1.66 -> libBoost 1.67 #74

Open

Description

@PiotrZSL

Problematic code:

#include <boost/optional/optional.hpp>

struct A
{
    A(int a) : a(a) {}

    int a;
};

 #define TRUE 1

int main()
{
    return boost::optional<A>(TRUE , 5)->a;
}

libBoost 1.66 calls here:
optional ( bool cond, rval_reference_type val )
boost::optional(1, A(5));
and returns 5,

libBoost 1.67 and newer calls here:
template
explicit optional ( Expr&& expr,
BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate<T, Expr>, bool>::type = true
)
and returns 1.

This is change of behavior without any warring.

Activity

  1. akrzemi1 commented on May 24, 2019

    @akrzemi1
    Member

    Thanks for reporting this. I just want to let you know that I recorded this issue. I am too busy at the moment to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions