aboutsummaryrefslogtreecommitdiff
path: root/equality.h
diff options
context:
space:
mode:
Diffstat (limited to 'equality.h')
-rw-r--r--equality.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/equality.h b/equality.h
index 77cd1a4..6fb4e72 100644
--- a/equality.h
+++ b/equality.h
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// -*- mode: C++ -*-
//
-// Copyright 2022 Google LLC
+// Copyright 2022-2024 Google LLC
//
// Licensed under the Apache License v2.0 with LLVM Exceptions (the
// "License"); you may not use this file except in compliance with the
@@ -160,6 +160,12 @@ struct Equals {
&& (*this)(x1.type_id, x2.type_id);
}
+ bool operator()(const VariantMember& x1, const VariantMember& x2) {
+ return x1.name == x2.name
+ && x1.discriminant_value == x2.discriminant_value
+ && (*this)(x1.type_id, x2.type_id);
+ }
+
bool operator()(const StructUnion& x1, const StructUnion& x2) {
const auto& definition1 = x1.definition;
const auto& definition2 = x2.definition;