]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] libmime: declare comparators const for doctest 2.4.12 compatibility 5458/head
authorAlexandra Parker <alex.iris.parker@gmail.com>
Wed, 7 May 2025 20:17:32 +0000 (13:17 -0700)
committerAlexandra Parker <alex.iris.parker@gmail.com>
Wed, 7 May 2025 20:23:54 +0000 (13:23 -0700)
Petr VanÄ›k pointed out a change in doctest 2.4.12 that broke the libmime
test code:
https://github.com/doctest/doctest/commit/d7a5eeb820b61cc3af8a61b3117f76a403b7742a

CHECK is now treats LHS as const and the compiler won't find non-const
operator== as a result. It's reasonable for comparators to be const, so
make them const.

Signed-Off-By: Alexandra Parker <alex.iris.parker@gmail.com>
src/libmime/mime_string.hxx

index b181576d331d4eb06821a12eca3fc1145c3fe22e..d6c11d018bde90ac83ccec0b8edf98aff33fd498 100644 (file)
@@ -497,19 +497,19 @@ public:
        }
 
        /* Comparison */
-       auto operator==(const basic_mime_string &other)
+       auto operator==(const basic_mime_string &other) const
        {
                return other.storage == storage;
        }
-       auto operator==(const storage_type &other)
+       auto operator==(const storage_type &other) const
        {
                return other == storage;
        }
-       auto operator==(const view_type &other)
+       auto operator==(const view_type &other) const
        {
                return other == storage;
        }
-       auto operator==(const CharT *other)
+       auto operator==(const CharT *other) const
        {
                if (other == NULL) {
                        return false;