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 <rtl/ustring.hxx>
12 #pragma clang diagnostic ignored "-Wunknown-warning-option" // for Clang < 13
13 #pragma clang diagnostic ignored "-Wunused-but-set-variable"
20 // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:sequentialassign]}}
21 s2
= s2
.getToken(0, '(');
31 // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:sequentialassign]}}
32 s2
= s2
.getToken(0, '(');
40 OUString
getFileSystemName();
42 OUString
aNullURL("");
43 void f(VolumeInfo _aVolumeInfo
)
45 OUString
aFileSysName(aNullURL
);
46 // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:sequentialassign]}}
47 aFileSysName
= _aVolumeInfo
.getFileSystemName();
55 B3DVector
getPerpendicular();
57 void f(B3DVector aNewVPN
)
59 B3DVector aNewToTheRight
= aNewVPN
;
60 // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:sequentialassign]}}
61 aNewToTheRight
= aNewToTheRight
.getPerpendicular();
67 void f(OUString s
, int x
)
70 // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:sequentialassign]}}
71 nPos
= s
.indexOf("x", nPos
);
80 s2
= s2
.getToken(0, '('); // no warning expected
89 void foo(Class1
& rOther
)
91 OUString s
= rOther
.m_field1
;
92 // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:sequentialassign]}}
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */