From cd5d370601ec4efba614294a74e77d5dffff48cf Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Tue, 10 Oct 2023 12:08:33 -0700 Subject: [PATCH] C++20 preparation: make operator != non-ambiguous. C++20 auto-generates the != operator from ==. However, if that operator accepts a potentiallly different type, this might result in an ambiguous operator (-Wambiguous-reversed-operator). This provides the explicitly defined operator. While at it: update expectations for smoke tests as pulled projects changed. --- .github/bin/smoke-test.sh | 10 +++++----- common/util/tree_operations_test.cc | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/bin/smoke-test.sh b/.github/bin/smoke-test.sh index 288577f10..89e67dbd1 100755 --- a/.github/bin/smoke-test.sh +++ b/.github/bin/smoke-test.sh @@ -134,8 +134,8 @@ ExpectedFailCount[preprocessor:ibex]=368 ExpectedFailCount[syntax:opentitan]=35 ExpectedFailCount[lint:opentitan]=35 -ExpectedFailCount[project:opentitan]=739 -ExpectedFailCount[preprocessor:opentitan]=1981 +ExpectedFailCount[project:opentitan]=752 +ExpectedFailCount[preprocessor:opentitan]=2020 ExpectedFailCount[syntax:sv-tests]=77 ExpectedFailCount[lint:sv-tests]=76 @@ -145,7 +145,7 @@ ExpectedFailCount[preprocessor:sv-tests]=139 ExpectedFailCount[syntax:caliptra-rtl]=21 ExpectedFailCount[lint:caliptra-rtl]=21 ExpectedFailCount[project:caliptra-rtl]=324 -ExpectedFailCount[preprocessor:caliptra-rtl]=758 +ExpectedFailCount[preprocessor:caliptra-rtl]=761 ExpectedFailCount[syntax:Cores-VeeR-EH2]=2 ExpectedFailCount[lint:Cores-VeeR-EH2]=2 @@ -154,8 +154,8 @@ ExpectedFailCount[preprocessor:Cores-VeeR-EH2]=43 ExpectedFailCount[syntax:cva6]=6 ExpectedFailCount[lint:cva6]=6 -ExpectedFailCount[project:cva6]=77 -ExpectedFailCount[preprocessor:cva6]=103 +ExpectedFailCount[project:cva6]=78 +ExpectedFailCount[preprocessor:cva6]=110 ExpectedFailCount[syntax:uvm]=1 ExpectedFailCount[lint:uvm]=1 diff --git a/common/util/tree_operations_test.cc b/common/util/tree_operations_test.cc index 216088cf7..dadbb37cf 100644 --- a/common/util/tree_operations_test.cc +++ b/common/util/tree_operations_test.cc @@ -146,6 +146,7 @@ class SimpleNode { void set_id(std::string&& new_id) { id_ = new_id; } bool operator==(const ThisType& other) const { return this == &other; } + bool operator!=(const ThisType& other) const { return !(*this == other); } friend std::ostream& operator<<(std::ostream& stream, const ThisType& self) { self.PrintRecursively(stream, 0);