r227765 - Actually we can just inline the base typedef and use the injected class name for the base class.
Benjamin Kramer
benny.kra at googlemail.com
Sun Feb 1 12:47:51 PST 2015
Author: d0k
Date: Sun Feb 1 14:47:51 2015
New Revision: 227765
URL: http://llvm.org/viewvc/llvm-project?rev=227765&view=rev
Log:
Actually we can just inline the base typedef and use the injected class name for the base class.
Modified:
cfe/trunk/include/clang/AST/CanonicalType.h
cfe/trunk/include/clang/AST/DeclTemplate.h
Modified: cfe/trunk/include/clang/AST/CanonicalType.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CanonicalType.h?rev=227765&r1=227764&r2=227765&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CanonicalType.h (original)
+++ cfe/trunk/include/clang/AST/CanonicalType.h Sun Feb 1 14:47:51 2015
@@ -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;
};
Modified: cfe/trunk/include/clang/AST/DeclTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=227765&r1=227764&r2=227765&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclTemplate.h (original)
+++ cfe/trunk/include/clang/AST/DeclTemplate.h Sun Feb 1 14:47:51 2015
@@ -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; }
};
More information about the cfe-commits
mailing list