summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp')
-rw-r--r--tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp42
1 files changed, 15 insertions, 27 deletions
diff --git a/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp b/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp
index 4430282403..6197863601 100644
--- a/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp
+++ b/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp
@@ -1,30 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QObject>
#include <QScopeGuard>
@@ -39,6 +15,18 @@
#if __has_include(<boost/shared_ptr.hpp>)
# include <boost/shared_ptr.hpp>
# include <boost/make_shared.hpp>
+
+# ifdef BOOST_NO_EXCEPTIONS
+// https://stackoverflow.com/a/9530546/134841
+// https://www.boost.org/doc/libs/1_79_0/libs/throw_exception/doc/html/throw_exception.html#throw_exception
+BOOST_NORETURN void boost::throw_exception(const std::exception &) { std::terminate(); }
+# if BOOST_VERSION >= 107300
+// https://www.boost.org/doc/libs/1_79_0/libs/throw_exception/doc/html/throw_exception.html#changes_in_1_73_0
+BOOST_NORETURN void boost::throw_exception(const std::exception &, const boost::source_location &)
+{ std::terminate(); }
+# endif // Boost v1.73
+# endif // BOOST_NO_EXCEPTIONS
+
# define ONLY_IF_BOOST(x) x
#else
# define ONLY_IF_BOOST(x) QSKIP("This benchmark requires Boost.SharedPtr.")