Actually we can just inline the base typedef and use the injected class name for the base class.

llvm-svn: 227765
This commit is contained in:
Benjamin Kramer 2015-02-01 20:47:51 +00:00
parent 04ec7e316b
commit 06e0f5a784
2 changed files with 9 additions and 14 deletions

View File

@ -382,20 +382,18 @@ namespace clang {
/// \brief Iterator adaptor that turns an iterator over canonical QualTypes
/// into an iterator over CanQualTypes.
template <typename InputIterator>
class CanTypeIterator
: public llvm::iterator_adaptor_base<
struct CanTypeIterator
: llvm::iterator_adaptor_base<
CanTypeIterator<InputIterator>, InputIterator,
typename std::iterator_traits<InputIterator>::iterator_category,
CanQualType,
typename std::iterator_traits<InputIterator>::difference_type,
CanProxy<Type>, CanQualType> {
typedef typename CanTypeIterator::iterator_adaptor_base BaseT;
public:
CanTypeIterator() {}
explicit CanTypeIterator(InputIterator Iter) : BaseT(std::move(Iter)) {}
explicit CanTypeIterator(InputIterator Iter)
: CanTypeIterator::iterator_adaptor_base(std::move(Iter)) {}
CanQualType operator*() const { return CanQualType::CreateUnsafe(*BaseT::I); }
CanQualType operator*() const { return CanQualType::CreateUnsafe(*this->I); }
CanProxy<Type> operator->() const;
};

View File

@ -552,23 +552,20 @@ protected:
template <typename EntryType, typename SETraits = SpecEntryTraits<EntryType>,
typename DeclType = typename SETraits::DeclType>
class SpecIterator
: public llvm::iterator_adaptor_base<
struct SpecIterator
: llvm::iterator_adaptor_base<
SpecIterator<EntryType, SETraits, DeclType>,
typename llvm::FoldingSetVector<EntryType>::iterator,
typename std::iterator_traits<typename llvm::FoldingSetVector<
EntryType>::iterator>::iterator_category,
DeclType *, ptrdiff_t, DeclType *, DeclType *> {
typedef typename SpecIterator::iterator_adaptor_base BaseT;
public:
SpecIterator() {}
explicit SpecIterator(
typename llvm::FoldingSetVector<EntryType>::iterator SetIter)
: BaseT(std::move(SetIter)) {}
: SpecIterator::iterator_adaptor_base(std::move(SetIter)) {}
DeclType *operator*() const {
return SETraits::getMostRecentDecl(&*BaseT::I);
return SETraits::getMostRecentDecl(&*this->I);
}
DeclType *operator->() const { return **this; }
};