From 905559f3f45991a0538912c1ca77199aa52fc7cf Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 14 Jul 2022 10:13:49 +0200 Subject: Adapt to Clang 15 trunk increase in ElabortatedType sugar ... "[clang] Implement ElaboratedType sugaring for types written bare". For one, it caused diagnostics to now emit 'OString' instead of 'rtl::OUString' etc., which required adapting a number of tests. For another, some tests started to fail because the relevant plugins didn't expect ElaboratedType sugar in places where it now occurs: > error: 'error' diagnostics expected but not seen: > File compilerplugins/clang/test/redundantcast.cxx Line 297: redundant cstyle cast from 'Enum1' to 'Enum1' [loplugin:redundantcast] > File compilerplugins/clang/test/redundantcast.cxx Line 308: redundant cstyle cast from 'Enum1' to 'Enum1' [loplugin:redundantcast] > error: 'error' diagnostics expected but not seen: > File compilerplugins/clang/test/referencecasting.cxx Line 25 (directive at compilerplugins/clang/test/referencecasting.cxx:24): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 37 (directive at compilerplugins/clang/test/referencecasting.cxx:36): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 48 (directive at compilerplugins/clang/test/referencecasting.cxx:47): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 100 (directive at compilerplugins/clang/test/referencecasting.cxx:99): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 120 (directive at compilerplugins/clang/test/referencecasting.cxx:119): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 188 (directive at compilerplugins/clang/test/referencecasting.cxx:187): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 200 (directive at compilerplugins/clang/test/referencecasting.cxx:199): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > File compilerplugins/clang/test/referencecasting.cxx Line 206 (directive at compilerplugins/clang/test/referencecasting.cxx:205): the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting] > error: 'error' diagnostics seen but not expected: > File compilerplugins/clang/test/typedefparam.cxx Line 42: function param 1 at definition site does not match function param at declaration site, 'FooT *' (aka 'test2::Foo *') vs 'struct Foo *' [loplugin:typedefparam] > File compilerplugins/clang/test/typedefparam.cxx Line 55: function param 1 at definition site does not match function param at declaration site, 'FooT *' (aka 'test3::Foo *') vs 'Foo *' [loplugin:typedefparam] > error: 'note' diagnostics seen but not expected: > File compilerplugins/clang/test/typedefparam.cxx Line 40: declaration site here [loplugin:typedefparam] > File compilerplugins/clang/test/typedefparam.cxx Line 53: declaration site here [loplugin:typedefparam] Hopefully, there are not too many places in our plugins left that similarly don't expect ElaboratedType sugar in certain places, but which are not covered by tests. At least, a full build didn't turn up any further false positives, but there may of course be false negatives now that would go undetected. Change-Id: I9bfb1cfb57df5f6e228b512c19c664d48285b675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137049 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/clang/test/getstr.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compilerplugins/clang/test/getstr.cxx') diff --git a/compilerplugins/clang/test/getstr.cxx b/compilerplugins/clang/test/getstr.cxx index 976d39c25c71..7522458c7011 100644 --- a/compilerplugins/clang/test/getstr.cxx +++ b/compilerplugins/clang/test/getstr.cxx @@ -37,11 +37,11 @@ void f(std::ostream& st, OString const& s1, OStringBuffer const& s2, OString* p1, OStringBuffer* p2, OUString* p3[[maybe_unused]], OUStringBuffer* p4[[maybe_unused]], S* p5, char const* (OString::*pf)() const) { - st << s1.getStr() // expected-error {{directly use object of type 'rtl::OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} + st << s1.getStr() // expected-error-re {{directly use object of type '{{(rtl::)?}}OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} << s2.getStr() #if !HAVE_DELETED_OPERATORS - << s3.getStr() // expected-error {{suspicious use of 'getStr' on an object of type 'rtl::OUString'; the result is implicitly cast to a void pointer in a call of 'operator <<' [loplugin:getstr]}} - << s4.getStr() // expected-error {{suspicious use of 'getStr' on an object of type 'rtl::OUStringBuffer'; the result is implicitly cast to a void pointer in a call of 'operator <<' [loplugin:getstr]}} + << s3.getStr() // expected-error-re {{suspicious use of 'getStr' on an object of type '{{(rtl::)?}}OUString'; the result is implicitly cast to a void pointer in a call of 'operator <<' [loplugin:getstr]}} + << s4.getStr() // expected-error-re {{suspicious use of 'getStr' on an object of type '{{(rtl::)?}}OUStringBuffer'; the result is implicitly cast to a void pointer in a call of 'operator <<' [loplugin:getstr]}} #endif << s5.getStr() // expected-error {{directly use object of type 'S' (aka 'rtl::OString') in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} << p1->getStr() // expected-error {{directly use object of type 'rtl::OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} @@ -52,7 +52,7 @@ void f(std::ostream& st, OString const& s1, OStringBuffer const& s2, #endif << p5->getStr() // expected-error {{directly use object of type 'rtl::OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} << (s1.*pf)(); - SAL_INFO( // expected-error 1+ {{directly use object of type 'rtl::OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} + SAL_INFO( // expected-error-re 1+ {{directly use object of type '{{(rtl::)?}}OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr]}} "test", s1.getStr()); } -- cgit