This bug was originally fixed in http://reviews.llvm.org/D7201.
However it was broken again by the fix to https://llvm.org/bugs/show_bug.cgi?id=22605.
This patch re-fixes wrap_iter with GCC by providing a forward declaration of <vector> before the friend declaration in wrap_iter.
This patch avoids the issues in PR22605 by putting canonical forward declarations in <iosfwd> and including <iosfwd> in <vector>.
<iosfwd> was chosen as the canonical forward declaration headers for the following reasons:
- <iosfwd> is small with almost no dependancies.
- It already forward declares std::allocator
- It is already included in <iterator> which we need to fix the GCC bug.
This patch fixes the test "gcc_workaround.pass.cpp"