File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
src/Beman/Optional26/tests Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ target_sources(
19
19
optional_ref.t.cpp
20
20
optional.t.cpp
21
21
optional_constexpr.t.cpp
22
- test_types.cpp)
22
+ test_types.cpp
23
+ test_utilities.cpp)
23
24
24
25
target_link_libraries(
25
26
beman_optional26_test
Original file line number Diff line number Diff line change 3
3
4
4
#include < Beman/Optional26/optional.hpp>
5
5
#include < Beman/Optional26/tests/test_types.hpp>
6
+ #include < Beman/Optional26/tests/test_utilities.hpp>
6
7
7
8
#include < functional>
8
9
#include < ranges>
@@ -220,7 +221,7 @@ consteval bool testConstexprInPlace() {
220
221
return retval;
221
222
}
222
223
223
- auto consteval constify ( auto expr) { return (expr); }
224
+ using beman::optional26::tests:: constify;
224
225
225
226
TEST (OptionalConstexprTest, InPlace) {
226
227
EXPECT_TRUE (constify (testConstexprInPlace ()));
Original file line number Diff line number Diff line change
1
+ // src/Beman/Optional26/test/test_utilities.cpp -*-C++-*-
2
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3
+
4
+ #include < Beman/Optional26/tests/test_utilities.hpp>
Original file line number Diff line number Diff line change
1
+ // src/Beman/Optional26/tests/test_utilities.hpp -*-C++-*-
2
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3
+
4
+ #ifndef BEMAN_OPTIONAL26_TESTS_TEST_UTILITIES_HPP
5
+ #define BEMAN_OPTIONAL26_TESTS_TEST_UTILITIES_HPP
6
+
7
+ namespace beman ::optional26::tests {
8
+ /* **
9
+ * Evaluate and return an expression in a consteval context for testing
10
+ * constexpr correctness.
11
+ */
12
+ auto consteval constify (auto expr) { return (expr); }
13
+ } // namespace beman::optional26::tests
14
+
15
+ #endif
You can’t perform that action at this time.
0 commit comments