[Libreoffice-commits] core.git: compilerplugins/clang
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 22 18:24:51 UTC 2021
compilerplugins/clang/test/consttobool.cxx | 2 +-
compilerplugins/clang/test/cppunitassertequals.cxx | 2 +-
compilerplugins/clang/test/redundantcast.cxx | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 27f3618a600006e59d6b45e22f0eb46457172a52
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Sep 22 16:05:17 2021 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Sep 22 20:24:14 2021 +0200
Adapt to Clang 14 trunk change in diagnostics
<https://github.com/llvm/llvm-project/commit/131e8786640a49daf533b7ead4d3b5b82e0aea2a>
"Print nullptr_t namespace qualified within std::"
Change-Id: Idb3ebceadfa5a831429b8c3239de426e599eb9c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122459
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/compilerplugins/clang/test/consttobool.cxx b/compilerplugins/clang/test/consttobool.cxx
index 3d880cb4d5d1..4fe41a8140f2 100644
--- a/compilerplugins/clang/test/consttobool.cxx
+++ b/compilerplugins/clang/test/consttobool.cxx
@@ -28,7 +28,7 @@ constexpr int c2 = 2;
struct S
{
S()
- // expected-error-re at +1 {{implicit conversion of constant {{nullptr|0}} of type 'nullptr_t' to 'bool'; use 'false' instead [loplugin:consttobool]}}
+ // expected-error-re at +1 {{implicit conversion of constant {{nullptr|0}} of type '{{(std::)?}}nullptr_t' to 'bool'; use 'false' instead [loplugin:consttobool]}}
: b(nullptr)
{
}
diff --git a/compilerplugins/clang/test/cppunitassertequals.cxx b/compilerplugins/clang/test/cppunitassertequals.cxx
index 9fe35cfc6919..48bea83f6088 100644
--- a/compilerplugins/clang/test/cppunitassertequals.cxx
+++ b/compilerplugins/clang/test/cppunitassertequals.cxx
@@ -55,7 +55,7 @@ void test(
// very meaningful, so let it use CPPUNIT_ASSERT (but stick to CPPUNIT_ASSERT_EQUAL for
// consistency in the unlikely case that P is of type std::nullptr_t):
CPPUNIT_ASSERT(p == nullptr);
- CPPUNIT_ASSERT(n == nullptr); // expected-error {{rather call CPPUNIT_ASSERT_EQUAL when comparing 'std::nullptr_t' (aka 'nullptr_t') and 'nullptr_t' (or rewrite as an explicit operator == call when the operator itself is the topic) [loplugin:cppunitassertequals]}}
+ CPPUNIT_ASSERT(n == nullptr); // expected-error-re {{rather call CPPUNIT_ASSERT_EQUAL when comparing 'std::nullptr_t'{{( \(aka 'nullptr_t'\))?}} and '{{(std::)?}}nullptr_t' (or rewrite as an explicit operator == call when the operator itself is the topic) [loplugin:cppunitassertequals]}}
// There might even be good reasons(?) not to warn inside explicit casts:
CPPUNIT_ASSERT(bool(b1 && b2));
diff --git a/compilerplugins/clang/test/redundantcast.cxx b/compilerplugins/clang/test/redundantcast.cxx
index 2a3721bb0c2e..319365d3676b 100644
--- a/compilerplugins/clang/test/redundantcast.cxx
+++ b/compilerplugins/clang/test/redundantcast.cxx
@@ -42,7 +42,7 @@ void testConstCast() {
void * vp = nullptr;
(void) const_cast<char *>(static_cast<char const *>(vp)); // expected-error {{redundant static_cast/const_cast combination from 'void *' via 'const char *' to 'char *' [loplugin:redundantcast]}}
- (void) const_cast<char *>(static_cast<char const *>(nullptr)); // expected-error {{redundant static_cast/const_cast combination from 'nullptr_t' via 'const char *' to 'char *' [loplugin:redundantcast]}}
+ (void) const_cast<char *>(static_cast<char const *>(nullptr)); // expected-error-re {{redundant static_cast/const_cast combination from '{{(std::)?}}nullptr_t' via 'const char *' to 'char *' [loplugin:redundantcast]}}
(void) const_cast<S &>(static_cast<S const &>(D{})); // expected-error {{redundant static_cast/const_cast combination from 'D' via 'const S &' to 'S &' [loplugin:redundantcast]}}
S const s{};
More information about the Libreoffice-commits
mailing list