Adapt loplugin:trivialconsructor to clang-cl

...where the S4 template constructor may still have an unparsed null body, so

    if (!constructorDecl->hasTrivialBody())
        return true;

will suppress the expected warning.  Lets just accept that clang-cl on Windows
will find less instances of loplugin:trivialconstructor.  (And moving the
expected-error comment around on the line was demanded by clang-format.  Oh my.)

Change-Id: I3357fbd0fbf932f7f93c421c2f079a8cfc536eef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132019
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2022-03-24 08:02:36 +01:00
parent d501a1c00c
commit 5ace52e6ae

View File

@@ -27,7 +27,9 @@ struct S3
template <typename> struct S4
{
// expected-error@+1 {{no need for explicit constructor decl [loplugin:trivialconstructor]}}
#if !defined _MSC_VER
// expected-error@+2 {{no need for explicit constructor decl [loplugin:trivialconstructor]}}
#endif
S4() {}
};