Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / compilerplugins / clang / test / commaoperator.cxx
blob6abe963ae7a9e2abb41cf90c6644272c5dc6ea5b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
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/.
8 */
10 bool f();
12 struct S { ~S(); };
14 int main() {
15 f(), f(), f(); // expected-error {{comma operator hides code [loplugin:commaoperator]}}
16 (f(), f());
17 for (
18 f(), f();
19 f(), f(); // expected-error {{comma operator hides code [loplugin:commaoperator]}}
20 f(), f())
21 f(), f(); // expected-error {{comma operator hides code [loplugin:commaoperator]}}
22 S s;
23 (s = S(), s = S(), s = S());
24 for (s = S(), f(); f(); s = S(), f()) {}
25 while (s = S(), f()) {}
28 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */