1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 #include "config_clang.h"
11 // clang before V9 does not have API to report exception spec type
12 #if CLANG_VERSION >= 90000
20 // expected-error@+1 {{move constructor can be noexcept [loplugin:noexceptmove]}}
21 Mapping(Mapping
&& other
)
22 : m_pMapping(other
.m_pMapping
)
24 other
.m_pMapping
= nullptr;
27 // expected-error@+1 {{move operator= can be noexcept [loplugin:noexceptmove]}}
28 Mapping
& operator=(Mapping
&& other
)
30 m_pMapping
= other
.m_pMapping
;
31 other
.m_pMapping
= nullptr;
37 // No warning expected, because calling throwing function.
40 void foo() noexcept(false);
48 // no warning expected, because calling throwing constructor
53 Foo() noexcept(false);
57 Bar(Bar
&&) { Foo aFoo
; }
68 // No warning expected, because calling throwing destructor.
73 ~Foo() noexcept(false);
78 Bar(Bar
&&) { Foo aFoo
; }
82 // Check for calls to defaulted constructors.
87 Foo() = default; // non-throwing
91 Bar(Bar
&&) // expected-error {{move constructor can be noexcept [loplugin:noexceptmove]}}
100 // expected-no-diagnostics
101 #endif // CLANG_VERSION
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */