diff options
| -rw-r--r-- | clang/test/Modules/Inputs/PR20399/FirstHeader.h | 11 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/PR20399/SecondHeader.h | 10 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/PR20399/stl_map.h | 30 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/PR20399/vector | 58 |
4 files changed, 30 insertions, 79 deletions
diff --git a/clang/test/Modules/Inputs/PR20399/FirstHeader.h b/clang/test/Modules/Inputs/PR20399/FirstHeader.h index c8005227b35..43adf3d847e 100644 --- a/clang/test/Modules/Inputs/PR20399/FirstHeader.h +++ b/clang/test/Modules/Inputs/PR20399/FirstHeader.h @@ -5,13 +5,10 @@ #include "stl_map.h" #include "vector" -struct A { - typedef std::map<int, int*>::iterator el; -}; +typedef std::map<int>::iterator el; -struct B { - ~B() {} - std::vector<int> fvec; // Cannot replace with simple mockup -}; +inline void func() { + std::vector<int>::func(); +} #endif diff --git a/clang/test/Modules/Inputs/PR20399/SecondHeader.h b/clang/test/Modules/Inputs/PR20399/SecondHeader.h index 8548cc563ab..92815e99648 100644 --- a/clang/test/Modules/Inputs/PR20399/SecondHeader.h +++ b/clang/test/Modules/Inputs/PR20399/SecondHeader.h @@ -3,11 +3,11 @@ #include "vector" -class Collection { - template <class T> struct Address { }; -}; +template <class T> +struct Address {}; -template <> struct Collection::Address<std::vector<bool> > - : public Collection::Address<std::vector<bool>::iterator> { }; +template <> +struct Address<std::vector<bool>> + : Address<std::vector<bool>::iterator> {}; #endif diff --git a/clang/test/Modules/Inputs/PR20399/stl_map.h b/clang/test/Modules/Inputs/PR20399/stl_map.h index 11da0425348..334f8b308f4 100644 --- a/clang/test/Modules/Inputs/PR20399/stl_map.h +++ b/clang/test/Modules/Inputs/PR20399/stl_map.h @@ -1,25 +1,13 @@ -namespace std -{ - template<typename _Iterator> - class reverse_iterator {}; +namespace std { +struct reverse_iterator {}; - template<typename _Iterator> - inline int* - operator-(const int& __x, const reverse_iterator<_Iterator>& __y) {}; +inline void +operator-(int __x, reverse_iterator __y) {} - template<typename _Tp> - struct _Rb_tree_iterator - { - typedef _Rb_tree_iterator<_Tp> _Self; - }; +template <typename _Key> +struct map { + typedef int iterator; - template <typename _Key, typename _Tp > - class map - { - public: - typedef _Rb_tree_iterator<int> iterator; - - template<typename _K1, typename _T1> - friend bool operator<(const map<_K1, _T1>&, const map<_K1, _T1>&); - }; + friend bool operator<(const map &, const map &); +}; } // namespace std diff --git a/clang/test/Modules/Inputs/PR20399/vector b/clang/test/Modules/Inputs/PR20399/vector index 379e4661d35..1e1b6705f51 100644 --- a/clang/test/Modules/Inputs/PR20399/vector +++ b/clang/test/Modules/Inputs/PR20399/vector @@ -1,51 +1,17 @@ -namespace std -{ - template<typename _Tp, typename _Alloc = int> - class vector - { - public: - int* _M_start; - int* _M_end_of_storage; +namespace std { +template <typename _Tp, typename _Alloc = int> +struct vector { + static void func() { vector *i, *j; i - j; } +}; - ~vector() - { this->_M_end_of_storage - this->_M_start; } - }; +struct bit_iterator { ~bit_iterator() {} }; - struct _Bit_iterator {}; +inline void operator-(int __x, const bit_iterator &__y) { +} - inline int* operator-(const _Bit_iterator& __x, const _Bit_iterator& __y) - { - return 0; - } - - struct _Bvector_base - { - struct _Bvector_impl - { - _Bit_iterator _M_start; - - _Bvector_impl() { } - }; - - public: - ~_Bvector_base() - { this->_M_deallocate(); } - - protected: - _Bvector_impl _M_impl; - - void _M_deallocate() {} - }; - - template<typename _Alloc> - class vector<bool, _Alloc> : protected _Bvector_base - { - typedef _Bvector_base _Base; - public: - typedef _Bit_iterator iterator; - - vector() - : _Base() { } - }; +template <typename _Alloc> +struct vector<bool, _Alloc> : bit_iterator { + typedef bit_iterator iterator; +}; } // namespace std |

