From b8a10164dca775cba85eafe63eac3fa1d8171f69 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 8 Sep 2025 21:19:50 +0200 Subject: [PATCH] Adapt loplugin::nullptr to recent libstdc++ 16 trunk change ... "libstdc++: Rename __cmp_cat::__unspec to __cmp_cat::__literal_zero." Change-Id: I8cac78bcfd9cf9c8a68f028d4b8ebc6ee7263129 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190685 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/clang/nullptr.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compilerplugins/clang/nullptr.cxx b/compilerplugins/clang/nullptr.cxx index 04fb5bf0f9fd..3189013fbc69 100644 --- a/compilerplugins/clang/nullptr.cxx +++ b/compilerplugins/clang/nullptr.cxx @@ -137,9 +137,11 @@ bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) { { break; // POSIX locale_t is left unspecified } - // Hack to handle libc++ and stdlibc++ `std::strong_ordering x; x < 0` etc.: + // Hack to handle libc++ and libstdc++ (libstdc++ < 16: __unspec; libstdc++ >= 16: + // __literal_zero) `std::strong_ordering x; x < 0` etc.: if (tc.MemberPointerOf().ClassOrStruct("_CmpUnspecifiedParam").StdNamespace() - || tc.Pointer().ClassOrStruct("__unspec").Namespace("__cmp_cat").StdNamespace()) + || tc.Pointer().ClassOrStruct("__unspec").Namespace("__cmp_cat").StdNamespace() + || tc.Pointer().ClassOrStruct("__literal_zero").Namespace("__cmp_cat").StdNamespace()) { break; }