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 <o3tl/typed_flags_set.hxx>
12 constexpr auto ONE
= 1;
13 constexpr auto TWO
= 2;
20 template<> struct typed_flags
<Enum1
> : is_typed_flags
<Enum1
, 0x3> {};
29 template<> struct typed_flags
<Enum2
> : is_typed_flags
<Enum2
, 0x3> {};
34 auto v1
= ONE
& TWO
; // expected-error {{expression always evaluates to zero, lhs=1 rhs=2 [loplugin:expressionalwayszero]}}
36 auto v2
= Enum1::ONE
& Enum1::TWO
; // expected-error {{expression always evaluates to zero, lhs=1 rhs=2 [loplugin:expressionalwayszero]}}
40 auto v4
= v3
& Enum2::ZERO
; // expected-error {{expression always evaluates to zero, lhs=unknown rhs=0 [loplugin:expressionalwayszero]}}
44 v5
&= Enum2::ZERO
; // expected-error {{expression always evaluates to zero, lhs=unknown rhs=0 [loplugin:expressionalwayszero]}}
46 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */