Page MenuHomePhabricator

[libc++][test] Fix noexcept assertions in variant's get tests
ClosedPublic

Authored by CaseyCarter on Apr 23 2019, 11:39 AM.

Details

Summary

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

Fixes #41578.

Diff Detail

Repository
rCXX libc++

Event Timeline

CaseyCarter created this revision.Apr 23 2019, 11:39 AM
CaseyCarter marked an inline comment as done.

Update conditional: the bug was closed as a duplicate of a bug which has been fixed on master. Tag with the correct bug number, and disable the workaround for GCC 9.

I added a patch to https://bugs.llvm.org/show_bug.cgi?id=41578 that fixes it differently.

mclow.lists added inline comments.Apr 24 2019, 6:12 AM
test/std/utilities/variant/variant.get/get_index.pass.cpp
60

You've got some copy-pasta here. 0 should be 1

CaseyCarter edited the summary of this revision. (Show Details)

Use Jonathan's fix, which additionally validates the existence of the bug.

CaseyCarter marked an inline comment as done.Apr 24 2019, 10:13 AM

Fix pre-existing copy pasta in variant/get_type.pass.cpp.

EricWF accepted this revision.Apr 25 2019, 1:50 AM

LGTM.

Thanks for the fixes.

This revision is now accepted and ready to land.Apr 25 2019, 1:50 AM
This revision was automatically updated to reflect the committed changes.