[Patch] Fix variant::operator= on references

Tim Shen timshen@google.com
Thu Sep 22 07:44:00 GMT 2016


Hi, this patch fixes the following compilation failure:

#include <variant>

int main()
{
   float f1 = 1.0f, f2 = 2.0f;

   std::variant<float&> v1(f1);

   v1 = f2; // #1
}

The bug is caused by a misuse of __storage. I also examined other
__storage usage, they all seem appropriate.

Tested on x86_64-linux-gnu.

Thanks!

-- 
Regards,
Tim Shen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.diff
Type: application/octet-stream
Size: 1444 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20160922/7af75735/attachment.obj>


More information about the Libstdc++ mailing list