diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-02-20 00:19:45 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-02-20 00:19:45 +0000 |
commit | 39c193b1f037ac5130dd48b8566fa3c9f34a2f3c (patch) | |
tree | cd9297e94ddd5bfbdd1d29de7236cbb802235c1e /libcxx/include/vector | |
parent | a6b7ebe2cd3b1cc95a195ebc6e4cfdd1584b415e (diff) | |
download | bcm5719-llvm-39c193b1f037ac5130dd48b8566fa3c9f34a2f3c.tar.gz bcm5719-llvm-39c193b1f037ac5130dd48b8566fa3c9f34a2f3c.zip |
Make __wrap_iter work with GCC again
Summary:
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:
1. `<iosfwd>` is small with almost no dependancies.
2. It already forward declares `std::allocator`
3. It is already included in `<iterator>` which we need to fix the GCC bug.
This patch fixes the test "gcc_workaround.pass.cpp"
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16345
llvm-svn: 261382
Diffstat (limited to 'libcxx/include/vector')
-rw-r--r-- | libcxx/include/vector | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/vector b/libcxx/include/vector index dbc0dd32182..0e413350de7 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -262,6 +262,7 @@ void swap(vector<T,Allocator>& x, vector<T,Allocator>& y) */ #include <__config> +#include <iosfwd> // for forward declaration of vector #include <__bit_reference> #include <type_traits> #include <climits> @@ -453,7 +454,7 @@ __vector_base<_Tp, _Allocator>::~__vector_base() } } -template <class _Tp, class _Allocator = allocator<_Tp> > +template <class _Tp, class _Allocator /* = allocator<_Tp> */> class _LIBCPP_TYPE_VIS_ONLY vector : private __vector_base<_Tp, _Allocator> { |