diff options
author | Giuliano Procida <gprocida@google.com> | 2023-08-31 16:59:15 +0100 |
---|---|---|
committer | Giuliano Procida <gprocida@google.com> | 2023-11-14 12:02:30 +0000 |
commit | e28c02f1a6213eef294b06a9d9183e1890ca69de (patch) | |
tree | 61fa3ddcfc2d9f85838ec01515624c2b74e8aa75 | |
parent | ab90424119637248436158c491c15056dd94c411 (diff) | |
download | libabigail-e28c02f1a6213eef294b06a9d9183e1890ca69de.tar.gz |
operator!= fixes for C++-20
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.
Bug: 295399968
Reported-by: Ilya Biryukov <ibiryukov@google.com>
Change-Id: Ic86fcb51866f4f86fcc8e7181e3b7577adbf918d
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
-rw-r--r-- | include/abg-ir.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/abg-ir.h b/include/abg-ir.h index 8d1d2922..d396c254 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -2197,6 +2197,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; @@ -2297,6 +2302,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; @@ -2361,6 +2371,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; @@ -4025,6 +4040,11 @@ public: 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); virtual ~class_or_union(); |