PR libstdc++/87431 optimise valueless_by_exception()
authorJonathan Wakely <jwakely@redhat.com>
Tue, 25 Sep 2018 14:59:16 +0000 (15:59 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 25 Sep 2018 14:59:16 +0000 (15:59 +0100)
commit16d30bbd4dae88ceb08bf8b965c8fd61b25b558c
tree8e0042be0f57004e04a37b31814ddd8dedeea26d
parent4fb792e189c183aa499e834d9cdc4b3ee3bd064a
PR libstdc++/87431 optimise valueless_by_exception()

If a std::variant can never get into valueless state then we don't need
to do a runtime check for a valid alternative.

PR libstdc++/87431
* include/std/variant (_Variant_storage<true, _Types...>::_M_valid):
Avoid runtime test when all alternatives are scalars and so cannot
throw during initialization.

From-SVN: r264574
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant