diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2021-06-20 10:21:16 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-24 17:35:49 +0430 |
commit | f820917a765d1ac74af5f66567becb955996b0d8 (patch) | |
tree | 98dc6d46387daef9ecedd815bd822753a2f8813a /Tests/AK/TestVariant.cpp | |
parent | 00915e89482994a07321fe0788e12cdab0b761fe (diff) | |
download | serenity-f820917a765d1ac74af5f66567becb955996b0d8.zip |
Everywhere: Use nothrow new with `adopt_{ref,own}_if_nonnull`
This commit converts naked `new`s to `AK::try_make` and `AK::try_create`
wherever possible. If the called constructor is private, this can not be
done, so we instead now use the standard-defined and compiler-agnostic
`new (nothrow)`.
Diffstat (limited to 'Tests/AK/TestVariant.cpp')
-rw-r--r-- | Tests/AK/TestVariant.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Tests/AK/TestVariant.cpp b/Tests/AK/TestVariant.cpp index 547ec3db24..1495fda1a6 100644 --- a/Tests/AK/TestVariant.cpp +++ b/Tests/AK/TestVariant.cpp @@ -160,7 +160,7 @@ TEST_CASE(return_values) TEST_CASE(return_values_by_reference) { - auto ref = adopt_ref_if_nonnull(new Object()); + auto ref = adopt_ref_if_nonnull(new (nothrow) Object()); Variant<int, String, float> the_value { 42.0f }; auto& value = the_value.visit( |