Boost logo

Boost :

Subject: [boost] Is this a MSVC bug?
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2014-05-06 07:45:41


Hi,
While tracking test failures in Boost.Optional library I discovered that
the following program fires an assert in MS VC++ compiler (v. 10.0, 11.0,
12.0):

#include <cassert>

const int global_i = 0;

struct TestingReferenceBinding
{
  void operator=(const int& ii)
  {
    assert(&ii == &global_i);
  }

  void operator=(int&&) { }
};

int main()
{
  TestingReferenceBinding ttt;
  ttt = global_i;
}

Do you know if this a bug in VC++, or if that is supposed to be valid?

Regards,
&rzej


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