]> granicus.if.org Git - clang/commitdiff
[ADT] Change iterator_adaptor_base's default template arguments to forward more under...
authorTim Shen <timshen91@gmail.com>
Tue, 9 Aug 2016 20:22:55 +0000 (20:22 +0000)
committerTim Shen <timshen91@gmail.com>
Tue, 9 Aug 2016 20:22:55 +0000 (20:22 +0000)
Summary:
The corresponding LLVM change: D23217.

LazyVector::iterator breaks, because int isn't an iterator type.
Since iterator_adaptor_base shouldn't be blamed to break at the call to
iterator_traits<int>::xxx, I'd rather "fix" LazyVector::iterator.

The perfect solution is to model "relative pointer", but it's beyond the goal of this patch.

Reviewers: chandlerc, bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23218

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278156 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExternalASTSource.h

index 81cf631c7a4aa785446537ece638909f8f38c72c..2e99f395f495578881092ffef2ddf89af2d94a77 100644 (file)
@@ -503,8 +503,9 @@ public:
   /// We define this as a wrapping iterator around an int. The
   /// iterator_adaptor_base class forwards the iterator methods to basic integer
   /// arithmetic.
-  class iterator : public llvm::iterator_adaptor_base<
-                       iterator, int, std::random_access_iterator_tag, T, int> {
+  class iterator
+      : public llvm::iterator_adaptor_base<
+            iterator, int, std::random_access_iterator_tag, T, int, T *, T &> {
     LazyVector *Self;
 
     iterator(LazyVector *Self, int Position)