From fd60c5a4879cb881b6c5abfe53ba80126ebb7303 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 18 May 2020 14:52:16 +0200 Subject: Adapt compilerplugins/clang/test/writeonlyvars.cxx ...to 1d0bc2139759f087d50432f8a2116060676f34e1 "use std::experimental::source_location in uno::Exception" Change-Id: I2b18dbae89c6f219edacba5d147ea265ca83725e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94422 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/clang/test/writeonlyvars.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compilerplugins/clang/test/writeonlyvars.cxx b/compilerplugins/clang/test/writeonlyvars.cxx index 740befb6f172..c2f78bddda88 100644 --- a/compilerplugins/clang/test/writeonlyvars.cxx +++ b/compilerplugins/clang/test/writeonlyvars.cxx @@ -16,6 +16,19 @@ #include #include +// See 1d0bc2139759f087d50432f8a2116060676f34e1 "use std::experimental::source_location in +// uno::Exception" modification to +// workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/Exception.hdl, which is indirectly +// included through the above #include directives, in turn causing conditional inclusion of +// include/o3tl/runtimetooustring.hxx (and where `ok` is only read in an assert in !NDEBUG builds): +#if defined LIBO_USE_SOURCE_LOCATION +// expected-error@o3tl/runtimetooustring.hxx:* {{read s [loplugin:writeonlyvars]}} +// expected-error@o3tl/runtimetooustring.hxx:* {{write s [loplugin:writeonlyvars]}} +#if !defined NDEBUG +// expected-error@o3tl/runtimetooustring.hxx:* {{read ok [loplugin:writeonlyvars]}} +#endif +#endif + namespace Bar { void test() -- cgit v1.2.3