Skip to content

Commit

Permalink
C++20 preparation: make operator != non-ambiguous.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hzeller committed Oct 10, 2023
1 parent e76eb27 commit cd5d370
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/bin/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions common/util/tree_operations_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cd5d370

Please sign in to comment.