libstdc++: Implement P1972R2 changes to std::variant (PR 95832)
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Jun 2020 09:24:49 +0000 (10:24 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 23 Jun 2020 09:25:26 +0000 (10:25 +0100)
commitc98fc4eb3afeda6ad8220d0d79bc1247a92c7c65
treea112fb75a18904fd747a38a883d0ac28556b099f
parenta2c5150e401a9c084f88b2d5576b29ef709dbadb
libstdc++: Implement P1972R2 changes to std::variant (PR 95832)

G++ implements P1972R2 since r11-1597-0ca22d027ecc and so we no longer
need the P0608R3 special case to prevent narrowing conversions to bool.

Since non-GNU compilers don't necessarily implment P1972R2 yet, this
may cause a regression for those compilers. There is no feature-test
macro we can use to detect it though, so we'll have to live with it.

libstdc++-v3/ChangeLog:

PR libstdc++/95832
* include/std/variant (__detail::__variant::_Build_FUN): Remove
partial specialization to prevent narrowing conversions to bool.
* testsuite/20_util/variant/compile.cc: Test non-narrowing
conversions to bool.
* testsuite/20_util/variant/run.cc: Likewise.
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/variant/compile.cc
libstdc++-v3/testsuite/20_util/variant/run.cc