diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-04 11:20:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-05 07:49:30 +0100 |
commit | e4472d3c139294499f4c0caeebd9d4e995958eb0 (patch) | |
tree | 3e62a6530f8b758dddab18981ee38cc76ecaef9e /compilerplugins/clang/test | |
parent | 126e5a4d5b1d6c7ba5b313786793a38f99488b33 (diff) |
loplugin:unnecessaryparen include more assignments
Change-Id: I9fb8366634b31230b732dd38a98f800075529714
Reviewed-on: https://gerrit.libreoffice.org/64510
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/test')
-rw-r--r-- | compilerplugins/clang/test/unnecessaryparen.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/compilerplugins/clang/test/unnecessaryparen.cxx b/compilerplugins/clang/test/unnecessaryparen.cxx index 8621fe9e8746..e89da95df384 100644 --- a/compilerplugins/clang/test/unnecessaryparen.cxx +++ b/compilerplugins/clang/test/unnecessaryparen.cxx @@ -9,6 +9,7 @@ #include <string> #include <rtl/ustring.hxx> +#include <o3tl/typed_flags_set.hxx> #define MACRO (1) @@ -18,6 +19,20 @@ enum class EFoo { Bar }; struct S { operator bool(); }; +enum class BrowseMode +{ + Modules = 0x01, + Top = 0x02, + Bottom = 0x04, + Left = 0x04, +}; +namespace o3tl +{ +template <> struct typed_flags<BrowseMode> : is_typed_flags<BrowseMode, 0xf> +{ +}; +} + int main() { int x = 1; @@ -94,15 +109,9 @@ int main() char *p = nullptr; delete (p); // expected-error {{parentheses immediately inside delete expr [loplugin:unnecessaryparen]}} -}; -struct S2 { - S2& GetText(); - void toChar(); -}; -void func2(S2 *p) -{ - (p->GetText()).toChar(); // expected-error {{unnecessary parentheses around member expr [loplugin:unnecessaryparen]}} + BrowseMode nBits = ( BrowseMode::Modules | BrowseMode::Top ); // expected-error {{parentheses immediately inside vardecl statement [loplugin:unnecessaryparen]}} + (void)nBits; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |