android: Reuse launcher icon in activities
[LibreOffice.git] / compilerplugins / clang / test / stringviewdangle.cxx
blob0a8d2aa54b446939fcafcf28f16b1cc2a95cc4f0
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 #include <sal/config.h>
12 #include <string_view>
13 #include <utility>
15 #include <rtl/strbuf.hxx>
16 #include <rtl/string.hxx>
17 #include <rtl/ustrbuf.hxx>
18 #include <rtl/ustring.hxx>
19 #include <sal/types.h>
21 namespace test1
23 OUString foo1();
24 OUString& foo2();
25 void f1()
27 // expected-error@+1 {{view pointing into temporary i.e. dangling [loplugin:stringviewdangle]}}
28 std::u16string_view v = foo1();
29 // expected-error@+1 {{view pointing into temporary i.e. dangling [loplugin:stringviewdangle]}}
30 v = foo1();
32 // no warning expected
33 std::u16string_view v2 = foo2();
34 v2 = foo2();
37 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */