r218840 - Reduce the PR20399 test case.

David Blaikie dblaikie at gmail.com
Wed Oct 1 16:16:30 PDT 2014


Author: dblaikie
Date: Wed Oct  1 18:16:30 2014
New Revision: 218840

URL: http://llvm.org/viewvc/llvm-project?rev=218840&view=rev
Log:
Reduce the PR20399 test case.

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.

Modified:
    cfe/trunk/test/Modules/Inputs/PR20399/FirstHeader.h
    cfe/trunk/test/Modules/Inputs/PR20399/SecondHeader.h
    cfe/trunk/test/Modules/Inputs/PR20399/stl_map.h
    cfe/trunk/test/Modules/Inputs/PR20399/vector

Modified: cfe/trunk/test/Modules/Inputs/PR20399/FirstHeader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/PR20399/FirstHeader.h?rev=218840&r1=218839&r2=218840&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/PR20399/FirstHeader.h (original)
+++ cfe/trunk/test/Modules/Inputs/PR20399/FirstHeader.h Wed Oct  1 18:16:30 2014
@@ -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

Modified: cfe/trunk/test/Modules/Inputs/PR20399/SecondHeader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/PR20399/SecondHeader.h?rev=218840&r1=218839&r2=218840&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/PR20399/SecondHeader.h (original)
+++ cfe/trunk/test/Modules/Inputs/PR20399/SecondHeader.h Wed Oct  1 18:16:30 2014
@@ -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

Modified: cfe/trunk/test/Modules/Inputs/PR20399/stl_map.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/PR20399/stl_map.h?rev=218840&r1=218839&r2=218840&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/PR20399/stl_map.h (original)
+++ cfe/trunk/test/Modules/Inputs/PR20399/stl_map.h Wed Oct  1 18:16:30 2014
@@ -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

Modified: cfe/trunk/test/Modules/Inputs/PR20399/vector
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/PR20399/vector?rev=218840&r1=218839&r2=218840&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/PR20399/vector (original)
+++ cfe/trunk/test/Modules/Inputs/PR20399/vector Wed Oct  1 18:16:30 2014
@@ -1,51 +1,17 @@
-namespace std
-{
-  template<typename _Tp, typename _Alloc = int>
-  class vector
-  {
-  public:
-    int* _M_start;
-    int* _M_end_of_storage;
-
-    ~vector()
-    { this->_M_end_of_storage - this->_M_start; }
-  };
-
-  struct _Bit_iterator {};
-
-  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() { }
-  };
+namespace std {
+template <typename _Tp, typename _Alloc = int>
+struct vector {
+  static void func() { vector *i, *j; i - j; }
+};
+
+struct bit_iterator { ~bit_iterator() {} };
+
+inline void operator-(int __x, const bit_iterator &__y) {
+}
+
+template <typename _Alloc>
+struct vector<bool, _Alloc> : bit_iterator {
+  typedef bit_iterator iterator;
+};
 
 } // namespace std





More information about the cfe-commits mailing list