bump product version to 6.3.0.0.beta1
[LibreOffice.git] / compilerplugins / clang / test / constvars.cxx
blob40f3250a65125210b13abc38f0686db7b0bb670c
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 #if defined _WIN32 //TODO, see corresponding TODO in compilerplugins/clang/writeonlyvars.cxx
11 // expected-no-diagnostics
12 #else
14 #include <com/sun/star/uno/Any.hxx>
16 namespace test1
18 int const aFormalArgs[] = { 1, 2 };
19 // expected-error@+1 {{static var can be const [loplugin:constvars]}}
20 static sal_uInt16 nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs);
21 sal_uInt16 foo()
23 (void)aFormalArgs;
24 return nMediaArgsCount;
28 // no warning expected
29 namespace test2
31 static char const* ar[] = { "xxxx" };
32 static const char* lcl_DATA_OTHERS = "localedata_others";
33 void foo()
35 (void)ar;
36 (void)lcl_DATA_OTHERS;
40 // no warning expected
41 namespace test3
43 static sal_uInt16 nMediaArgsCount = 1; // loplugin:constvars:ignore
44 sal_uInt16 foo() { return nMediaArgsCount; }
47 #endif
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */