[clang-pseudo] Forest.h - don't inherit from std::iterator
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 9 Aug 2022 09:18:40 +0000 (10:18 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 9 Aug 2022 09:18:53 +0000 (10:18 +0100)
Now that we've updated to C++17 MSVC gives very verbose warnings about not creating classes that inherit from std::iterator - use llvm::iterator_facade_base instead

Fixes #57005

clang-tools-extra/pseudo/include/clang-pseudo/Forest.h

index ef9a222..130cf1a 100644 (file)
@@ -199,7 +199,9 @@ private:
 };
 
 class ForestNode::RecursiveIterator
-    : public std::iterator<std::input_iterator_tag, const ForestNode> {
+    : public llvm::iterator_facade_base<ForestNode::RecursiveIterator,
+                                        std::input_iterator_tag,
+                                        const ForestNode> {
   llvm::DenseSet<const ForestNode *> Seen;
   struct StackFrame {
     const ForestNode *Parent;