]> granicus.if.org Git - clang/commitdiff
Reduce the PR20399 test case.
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 1 Oct 2014 23:16:30 +0000 (23:16 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 1 Oct 2014 23:16:30 +0000 (23:16 +0000)
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

test/Modules/Inputs/PR20399/FirstHeader.h
test/Modules/Inputs/PR20399/SecondHeader.h
test/Modules/Inputs/PR20399/stl_map.h
test/Modules/Inputs/PR20399/vector

index c8005227b35748fe8643461c841a6b4be2efeb1f..43adf3d847ed5a76a60cfccc66e0fca02322af0d 100644 (file)
@@ -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
index 8548cc563abd4af8879916c63acf3520d0788deb..92815e996482cb503f32a46426d122164d1f4af6 100644 (file)
@@ -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
index 11da04253483099b9ffaa28f1cba3a7a60829771..334f8b308f4056e340f73d2b04563af05485bd17 100644 (file)
@@ -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
index 379e4661d354720c46534384e27773c9b8917d0c..1e1b6705f51bcb6eacb586d476f35af4b8c94c02 100644 (file)
@@ -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