From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by sourceware.org (Postfix) with ESMTPS id BF3FF3858D20 for ; Thu, 31 Aug 2023 15:59:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF3FF3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=flex--gprocida.bounces.google.com Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-58d9e327d3aso13612827b3.3 for ; Thu, 31 Aug 2023 08:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1693497559; x=1694102359; darn=sourceware.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=BYffjPOgLIVYS59Nua7nJh+cZUzFMkVdFmpTz68n9qY=; b=ZcAtSPhJo6c/F6nCYLZSq/Uyw0vx1jl1PY6G8QbJo2ZPQzZpDhykw0nG8tKc/09JAY gI3Ku+5CPmZrsVwkkNaaxaz+TEVajWo7GXhvoeKY1PedGbWE/QnnZv++GVzty2Ujh6Gn b5Zsq1vbrjp3a49MtaUie91jaR4qiDdK7Ylb+hWf252vO0f7SwtX/w8bXJLunmO6Drl7 y0LhW9jcv7wJ8oF2pADBMoU/Ja2gItyE+r6DJiP3T/tMV4l1EiBc239BZA9Ky78OMm2S 493ikSacwK2WMSzAnHokk1h4XT18rACBQCkcGMnXCosUO4lbrlsfZTF7RWEECyXNpaJJ Q5nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693497559; x=1694102359; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BYffjPOgLIVYS59Nua7nJh+cZUzFMkVdFmpTz68n9qY=; b=E0i/Iqld6upkgZWNyRviP49YiOoNvQ2o2tePQeLwVmxHpYQS3cKssJXBWwaL2kPo1L BGthj3ks75faCaGGf6nq6KuYuj/nqHXikuqMJtCLjTecYNLqmHtAd/4XwHFPHT8YVseM Y8bdpkd/ZdCCs2B0ZEbwz4IfmLaapQ0NJPnstweBiL6EjBcaoDf/zT+hGpfRexoaPptc cWzB2yU3qf7Ecidgah/7qIMVL90kjXOG/D056MCXhx/alHBvFymNsLSMJ73BC4KxOQEB e31q5MEQHKVJdYWQf1YcV0kjFA6LjzF/Bb617Tm7QXeuc1SQ4cFMH046pR0Sr+7InNyT rgdQ== X-Gm-Message-State: AOJu0Yw7GIkurdoAW4MGoI2zoDsc0g4jDUrW/sc8Y5c68+z8bGlG88DP 0mq1Z9ARnVhJ5arhgBU4lcFS2nPypb8/WX8teeWWaadXewmFFY0S5R0CBsvp486uVtKuQTWELG3 0X8OucMHeBC9qbFE2d/Mj4hiCnCFcEt344GT5c/w8PNThLevCuXeJbd7SpJ57TkfLD2kf3YA= X-Google-Smtp-Source: AGHT+IEiTYGAc6anpcLX1CDvWDSO+yMDjWrPoA7RNN4pU4Q5IU1lZlaY9OokuKQg0sZQfljed2UXUGMbrsZw/g== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:209:ffc2:b944:7a20:7b33]) (user=gprocida job=sendgmr) by 2002:a81:bd07:0:b0:586:50cf:e13f with SMTP id b7-20020a81bd07000000b0058650cfe13fmr162985ywi.1.1693497559005; Thu, 31 Aug 2023 08:59:19 -0700 (PDT) Date: Thu, 31 Aug 2023 16:59:15 +0100 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.rc2.253.gd59a3bf2b4-goog Message-ID: <20230831155915.573382-1-gprocida@google.com> Subject: [PATCH] operator!= fixes for C++-20 From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com, maennich@google.com, sidnayyar@google.com, vvvvvv@google.com, Ilya Biryukov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-21.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Without these changes, more recent versions of Clang will start to emit diagnostics: src/abg-ir.cc:15407:13: error: member 'operator!=' found in multiple base classes of different types 15407 | return *l == *r; | ^ src/abg-ir.cc:14123:12: note: member found by ambiguous name lookup 14123 | type_base::operator!=(const type_base& other) const | ^ src/abg-ir.cc:5162:12: note: member found by ambiguous name lookup 5162 | decl_base::operator!=(const decl_base& other) const | ^ This fix was contributed by Ilya Biryukov. * include/abg-ir.h (qualified_typedef): Add definition of operator!=. (pointer_type_def): Likewise. (reference_type_def): Likewise. (class_or_union): Likewise. Reported-by: Ilya Biryukov Signed-off-by: Giuliano Procida --- include/abg-ir.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/abg-ir.h b/include/abg-ir.h index 85c14266..e6728112 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -2252,6 +2252,11 @@ public: virtual bool operator==(const qualified_type_def&) const; + virtual bool + operator!=(const qualified_type_def& other) const { + return !(*this == other); + } + CV get_cv_quals() const; @@ -2354,6 +2359,11 @@ public: bool operator==(const pointer_type_def&) const; + bool + operator!=(const pointer_type_def& other) const { + return !(*this == other); + } + const type_base_sptr get_pointed_to_type() const; @@ -2418,6 +2428,11 @@ public: bool operator==(const reference_type_def&) const; + bool + operator!=(const reference_type_def& other) const { + return !(*this == other); + } + type_base_sptr get_pointed_to_type() const; @@ -4092,6 +4107,11 @@ public: virtual bool operator==(const class_or_union&) const; + virtual bool + operator !=(const class_or_union& other) const { + return !(*this == other); + } + virtual bool traverse(ir_node_visitor& v); -- 2.42.0.rc2.253.gd59a3bf2b4-goog