[libc++][test] Fix noexcept assertions in variant's get tests
authorCasey Carter <Casey@Carter.net>
Thu, 25 Apr 2019 18:36:29 +0000 (18:36 +0000)
committerCasey Carter <Casey@Carter.net>
Thu, 25 Apr 2019 18:36:29 +0000 (18:36 +0000)
commit413732354d2a304cf312d9cc7227c80067d21d36
tree058d9ff5c06d1a7f8335af5bdac4af3340143d85
parentf9c30eddd013452dafe3649c3c05a74530a43c2d
[libc++][test] Fix noexcept assertions in variant's get tests

All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+.

Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers.

Differential Revision: https://reviews.llvm.org/D61033

llvm-svn: 359220
libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
libcxx/test/support/test_workarounds.h