[compiler] fix full-debug build with gcc 6

At least under some circumstances (GCC 6 with x64 Linux for me),
the code in `serializer-for-background-compilation.cc` guarded by
`ENABLE_SLOW_DCHECKS` attempts to use `std::iterator_traits` on the
`FunctionalList`, which previously failed compilation because
the standard iterator member types were unavailable.
This adds these members.

Refs: https://chromium-review.googlesource.com/c/v8/v8/+/1800578

Change-Id: Ifece423fce31d98777c6a65ef442623c321ecba3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1921800
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65014}
This commit is contained in:
Anna Henningsen 2019-11-18 17:14:14 +01:00 committed by Commit Bot
parent 2ad37be294
commit fc17585796

View File

@ -5,6 +5,7 @@
#ifndef V8_COMPILER_FUNCTIONAL_LIST_H_
#define V8_COMPILER_FUNCTIONAL_LIST_H_
#include <iterator>
#include "src/zone/zone.h"
namespace v8 {
@ -106,6 +107,14 @@ class FunctionalList {
}
bool operator!=(const iterator& other) const { return !(*this == other); }
// Implemented so that std::find and friends can use std::iterator_traits
// for this iterator type.
typedef std::forward_iterator_tag iterator_category;
typedef ptrdiff_t difference_type;
typedef A value_type;
typedef A* pointer;
typedef A& reference;
private:
Cons* current_;
};