Boost logo

Boost :

Subject: [boost] Help identify the conversion bug in MSVC
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2014-09-08 04:35:12


Hi,
I found a bug in MSVC 10.0 that causes a bug in Boost.Optional. I will be
trying to find a workaround for the compiler. I would like to ask people
with the access to MSVC 11.0 and 12.0 to check if the bug also persist in
these newer releases.

The following code is expected to compile:

struct A
{
  A(int) {}
  A(A &&) {}
};

struct B
{
  operator A() { return A(1); }
  operator int() { return 0; }
};

int main()
{
  A t = B();
}

The following code is expected *NOT *to compile:

struct A
{
  A(int) {}
};

struct B
{
  operator int() { return 0; }
};

int main()
{
  A t = B();
}

Please let me know what your compiler says.

Thanks,
&rzej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk