From 5ace52e6aef6f602ce8bf367b45ab2b740a85cd6 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 24 Mar 2022 08:02:36 +0100 Subject: 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 --- compilerplugins/clang/test/trivialconstructor.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compilerplugins/clang') diff --git a/compilerplugins/clang/test/trivialconstructor.cxx b/compilerplugins/clang/test/trivialconstructor.cxx index 5b48c4cf4250..eed26f8bf305 100644 --- a/compilerplugins/clang/test/trivialconstructor.cxx +++ b/compilerplugins/clang/test/trivialconstructor.cxx @@ -27,7 +27,9 @@ struct S3 template 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() {} }; -- cgit v1.2.3