Skip to content

Commit ed995a2

Browse files
can't intentionally throw in constexpr
1 parent 0574be6 commit ed995a2

File tree

1 file changed

+5
-0
lines changed
  • libcxx/test/std/containers/associative/map/map.access

1 file changed

+5
-0
lines changed

libcxx/test/std/containers/associative/map/map.access/at.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ TEST_CONSTEXPR_CXX26 bool test() {
4242
assert(m.at(4) == 4.5);
4343
assert(m.at(5) == 5.5);
4444
#ifndef TEST_HAS_NO_EXCEPTIONS
45+
46+
// throwing is not allowed in constexpr
47+
#if TEST_STD_VER < 26
4548
try {
4649
TEST_IGNORE_NODISCARD m.at(6);
4750
assert(false);
4851
} catch (std::out_of_range&) {
4952
}
53+
#endif
54+
5055
#endif
5156
assert(m.at(7) == 7.5);
5257
assert(m.at(8) == 8.5);

0 commit comments

Comments
 (0)