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/.
10 #include <sal/config.h>
14 #include <initializer_list>
16 #include <com/sun/star/uno/Sequence.hxx>
17 #include <sal/types.h>
19 template <typename T
> struct Sequence
21 Sequence(std::initializer_list
<T
>);
24 template <typename T
> struct Wrap1
29 template <typename T
> struct Wrap2
44 // expected-error@+1 {{implicit conversion (IntegralCast) from 'bool' to 'int' [loplugin:implicitboolconversion]}}
46 // expected-error@+1 {{implicit conversion (IntegralCast) from 'bool' to 'int' [loplugin:implicitboolconversion]}}
49 std::atomic
<bool> b
= false;
51 //TODO: Emit only one diagnostic here:
52 // expected-error@+2 {{implicit conversion (ConstructorConversion) from 'bool' to 'std::atomic<int>' [loplugin:implicitboolconversion]}}
53 // expected-error-re@+1 {{implicit conversion (IntegralCast) from 'bool' to {{.+}} [loplugin:implicitboolconversion]}}
54 std::atomic
<int> a
= false;
59 Sequence
<sal_Bool
> s1
{ false };
61 Sequence
<Sequence
<sal_Bool
>> s2
{ { false } };
63 // expected-error@+1 {{implicit conversion (IntegralCast) from 'bool' to 'const int' [loplugin:implicitboolconversion]}}
64 Sequence
<int> s3
{ false };
66 // expected-error@+1 {{implicit conversion (IntegralCast) from 'bool' to 'const int' [loplugin:implicitboolconversion]}}
67 Sequence
<Sequence
<int>> s4
{ { false } };
69 Wrap1
<sal_Bool
> w1
{ false };
70 Sequence
<Wrap1
<sal_Bool
>> s5
{ { false } };
72 Wrap2
<sal_Bool
> w2
{ false };
74 Sequence
<Wrap2
<sal_Bool
>> s6
{ { false } };
77 css::uno::Sequence
<sal_Bool
> s7(1);
79 std::array
<sal_Bool
, 1> s8
;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */