I couldn't get something /really/ obvious, and I imagine Richard Smith
might be able to provide some text explaining the sequence of steps
that's demonstrated by these files - but at least it's a bit simpler
now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218840
91177308-0d34-0410-b5e6-
96231b3b80d8
#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
#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
-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
-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