diff options
author | Philipp Hofer <philipp.hofer@protonmail.com> | 2020-11-12 12:51:50 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2020-11-22 01:56:05 +0100 |
commit | c096ab87c8a11e8d75dc689ea7024288419cfd22 (patch) | |
tree | cbf5e56d19dcb3fd3e68db3688f88d985c950a80 /compilerplugins/clang/test | |
parent | b35232bdf56fbda34476cf537d53bbea31235a95 (diff) |
tdf#123936 Formatting files in module compilerplugins with clang-format
Change-Id: Ie6e23d3d2a20849e47d048b439d72fd7376c53db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105654
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'compilerplugins/clang/test')
-rw-r--r-- | compilerplugins/clang/test/datamembershadow.cxx | 6 | ||||
-rw-r--r-- | compilerplugins/clang/test/external.hxx | 5 | ||||
-rw-r--r-- | compilerplugins/clang/test/oslendian-1.cxx | 12 | ||||
-rw-r--r-- | compilerplugins/clang/test/redundantcast.hxx | 11 | ||||
-rw-r--r-- | compilerplugins/clang/test/stringconcatauto.cxx | 34 |
5 files changed, 33 insertions, 35 deletions
diff --git a/compilerplugins/clang/test/datamembershadow.cxx b/compilerplugins/clang/test/datamembershadow.cxx index a11a7cc51c65..ef8722d5c806 100644 --- a/compilerplugins/clang/test/datamembershadow.cxx +++ b/compilerplugins/clang/test/datamembershadow.cxx @@ -11,11 +11,13 @@ #include <config_clang.h> -struct Bar { +struct Bar +{ int x; // expected-note {{superclass member here [loplugin:datamembershadow]}} }; -struct Foo : public Bar { +struct Foo : public Bar +{ int x; // expected-error {{data member x is shadowing member in superclass, through inheritance path Foo->Bar [loplugin:datamembershadow]}} }; diff --git a/compilerplugins/clang/test/external.hxx b/compilerplugins/clang/test/external.hxx index 749fec0ee3c7..40e8d55c0afe 100644 --- a/compilerplugins/clang/test/external.hxx +++ b/compilerplugins/clang/test/external.hxx @@ -11,10 +11,9 @@ extern int n0; -namespace N { - +namespace N +{ extern int v1; - } struct S; diff --git a/compilerplugins/clang/test/oslendian-1.cxx b/compilerplugins/clang/test/oslendian-1.cxx index 7349239aa98d..7d0023037f75 100644 --- a/compilerplugins/clang/test/oslendian-1.cxx +++ b/compilerplugins/clang/test/oslendian-1.cxx @@ -24,24 +24,24 @@ #if !defined OSL_BIGENDIAN #define OSL_BIGENDIAN - // expected-error@-1 {{macro 'OSL_BIGENDIAN' defined in addition to 'OSL_LITENDIAN' [loplugin:oslendian]}} - // expected-note@osl/endian.h:* {{conflicting macro definition is here [loplugin:oslendian]}} +// expected-error@-1 {{macro 'OSL_BIGENDIAN' defined in addition to 'OSL_LITENDIAN' [loplugin:oslendian]}} +// expected-note@osl/endian.h:* {{conflicting macro definition is here [loplugin:oslendian]}} #endif #if !defined OSL_LITENDIAN #define OSL_LITENDIAN - // expected-error@-1 {{macro 'OSL_LITENDIAN' defined in addition to 'OSL_BIGENDIAN' [loplugin:oslendian]}} - // expected-note@osl/endian.h:* {{conflicting macro definition is here [loplugin:oslendian]}} +// expected-error@-1 {{macro 'OSL_LITENDIAN' defined in addition to 'OSL_BIGENDIAN' [loplugin:oslendian]}} +// expected-note@osl/endian.h:* {{conflicting macro definition is here [loplugin:oslendian]}} #endif #if defined OSL_BIGENDIAN #undef OSL_BIGENDIAN - // expected-error@-1 {{macro 'OSL_BIGENDIAN' undefinition [loplugin:oslendian]}} +// expected-error@-1 {{macro 'OSL_BIGENDIAN' undefinition [loplugin:oslendian]}} #endif #if defined OSL_LITENDIAN #undef OSL_LITENDIAN - // expected-error@-1 {{macro 'OSL_LITENDIAN' undefinition [loplugin:oslendian]}} +// expected-error@-1 {{macro 'OSL_LITENDIAN' undefinition [loplugin:oslendian]}} #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/test/redundantcast.hxx b/compilerplugins/clang/test/redundantcast.hxx index 113dd0f1a8e8..0afab0c2dc07 100644 --- a/compilerplugins/clang/test/redundantcast.hxx +++ b/compilerplugins/clang/test/redundantcast.hxx @@ -9,23 +9,24 @@ #pragma once -struct S { +struct S +{ void f1(); void f2() const; void f3(); void f3() const; }; -int && nix(); -int const && cix(); +int&& nix(); +int const&& cix(); int nir(); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wignored-qualifiers" int const cir(); #pragma clang diagnostic pop -S && nsx(); -S const && csx(); +S&& nsx(); +S const&& csx(); S nsr(); S const csr(); diff --git a/compilerplugins/clang/test/stringconcatauto.cxx b/compilerplugins/clang/test/stringconcatauto.cxx index 6c9a72c293b3..8318e3c4a26f 100644 --- a/compilerplugins/clang/test/stringconcatauto.cxx +++ b/compilerplugins/clang/test/stringconcatauto.cxx @@ -13,24 +13,24 @@ void foo() { - auto str1 = "str1" + OUString::number( 10 ); + auto str1 = "str1" + OUString::number(10); // expected-error-re@-1 {{creating a variable of type 'rtl::OUStringConcat<{{.*}}>' will make it reference temporaries}} // expected-note@-2 {{use OUString instead}} - OUString str2 = "str2" + OUString::number( 20 ) + "ing"; - const auto& str3 = "str3" + OUString::number( 30 ); + OUString str2 = "str2" + OUString::number(20) + "ing"; + const auto& str3 = "str3" + OUString::number(30); // expected-error-re@-1 {{creating a variable of type 'const rtl::OUStringConcat<{{.*}}> &' will make it reference temporaries}} // expected-note@-2 {{use OUString instead}} - const auto str4 = "str4" + OString::number( 40 ); + const auto str4 = "str4" + OString::number(40); // expected-error-re@-1 {{creating a variable of type 'const rtl::OStringConcat<{{.*}}>' will make it reference temporaries}} // expected-note@-2 {{use OString instead}} - auto str5 = OUString::number( 50 ); + auto str5 = OUString::number(50); // expected-error-re@-1 {{creating a variable of type 'rtl::OUStringNumber<{{.*}}>' will make it reference temporaries}} // expected-note@-2 {{use OUString instead}} - (void) str1; - (void) str2; - (void) str3; - (void) str4; - (void) str5; + (void)str1; + (void)str2; + (void)str3; + (void)str4; + (void)str5; } struct A @@ -39,29 +39,25 @@ struct A // expected-error-re@-1 {{returning a variable of type 'rtl::OStringConcat<{{.*}}>' will make it reference temporaries}} // expected-note@-2 {{use OString instead}} { - return "bar" + OString::number( 110 ); + return "bar" + OString::number(110); } auto baz() // expected-error-re@-1 {{returning a variable of type 'rtl::OStringNumber<{{.*}}>' will make it reference temporaries}} // expected-note@-2 {{use OString instead}} { - return OString::number( 120 ); + return OString::number(120); } }; -template< typename T > -void fun( const T& par ) +template <typename T> void fun(const T& par) // parameters are without warnings { const T& var = par; // expected-error-re@-1 {{creating a variable of type 'const rtl::OUStringConcat<{{.*}}> &' will make it reference temporaries}} // expected-note@-2 {{use OUString instead}} - (void) var; + (void)var; } -void testfun() -{ - fun( "fun" + OUString::number( 200 )); -} +void testfun() { fun("fun" + OUString::number(200)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |