From 9f01d2a591922accee455e9c6ca02107fa57047c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Bossu?= Date: Tue, 27 Feb 2024 14:20:34 +0000 Subject: [PATCH] Fix C++17 std::iterator deprecation warning in CodeGenFormat --- llvm/utils/TableGen/CodeGenFormat.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/CodeGenFormat.h b/llvm/utils/TableGen/CodeGenFormat.h index ede68e1c996f..0544cfcbc189 100644 --- a/llvm/utils/TableGen/CodeGenFormat.h +++ b/llvm/utils/TableGen/CodeGenFormat.h @@ -683,9 +683,14 @@ class TGFieldLayout { /// NOTE: We can also implement a base abstract class defining the interface /// of this iterator and then make it derives from it (could be nice if we need /// to implement a BFS version of this iterator). -class TGFieldIterator - : public std::iterator { +class TGFieldIterator { public: + using iterator_category = std::forward_iterator_tag; + using value_type = TGFieldIterator; + using difference_type = std::ptrdiff_t; + using pointer = TGFieldIterator *; + using reference = TGFieldIterator &; + /// Traversal Modes enum class Mode { FullTraversal, StopTraversal };