From e2ac3060fd5136953980d7599d7194f6779a06f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Tue, 1 Mar 2022 14:05:03 +0100 Subject: [PATCH] Fix C++20 interaction (LLVM 14) Ref: https://github.com/intel/hyperscan/pull/345 --- src/rose/rose_graph.h | 4 ++-- src/util/ue2_graph.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rose/rose_graph.h b/src/rose/rose_graph.h index 499d796ac..b5bf1985d 100644 --- a/src/rose/rose_graph.h +++ b/src/rose/rose_graph.h @@ -112,7 +112,7 @@ struct LeftEngInfo { } size_t hash() const; void reset(void); - operator bool() const; + explicit operator bool() const; bool tracksSom() const { return !!haig; } }; @@ -133,7 +133,7 @@ struct RoseSuffixInfo { bool operator<(const RoseSuffixInfo &b) const; size_t hash() const; void reset(void); - operator bool() const { return graph || castle || haig || rdfa || tamarama; } + explicit operator bool() const { return graph || castle || haig || rdfa || tamarama; } }; /** \brief Properties attached to each Rose graph vertex. */ diff --git a/src/util/ue2_graph.h b/src/util/ue2_graph.h index b8e2e935d..b6fe1e368 100644 --- a/src/util/ue2_graph.h +++ b/src/util/ue2_graph.h @@ -176,7 +176,7 @@ class vertex_descriptor : totally_ordered> { vertex_descriptor() : p(nullptr), serial(0) {} explicit vertex_descriptor(vertex_node *pp) : p(pp), serial(pp->serial) {} - operator bool() const { return p; } + explicit operator bool() const { return p; } bool operator<(const vertex_descriptor b) const { if (p && b.p) { /* no vertices in the same graph can have the same serial */ @@ -215,7 +215,7 @@ class edge_descriptor : totally_ordered> { assert(tup.second == (bool)tup.first); } - operator bool() const { return p; } + explicit operator bool() const { return p; } bool operator<(const edge_descriptor b) const { if (p && b.p) { /* no edges in the same graph can have the same serial */