From: David Blaikie Date: Wed, 1 Oct 2014 23:16:30 +0000 (+0000) Subject: Reduce the PR20399 test case. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f48a75892440206247b80d1ef5f50d97dda2fa82;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218840 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Modules/Inputs/PR20399/FirstHeader.h b/test/Modules/Inputs/PR20399/FirstHeader.h index c8005227b3..43adf3d847 100644 --- a/test/Modules/Inputs/PR20399/FirstHeader.h +++ b/test/Modules/Inputs/PR20399/FirstHeader.h @@ -5,13 +5,10 @@ #include "stl_map.h" #include "vector" -struct A { - typedef std::map::iterator el; -}; +typedef std::map::iterator el; -struct B { - ~B() {} - std::vector fvec; // Cannot replace with simple mockup -}; +inline void func() { + std::vector::func(); +} #endif diff --git a/test/Modules/Inputs/PR20399/SecondHeader.h b/test/Modules/Inputs/PR20399/SecondHeader.h index 8548cc563a..92815e9964 100644 --- a/test/Modules/Inputs/PR20399/SecondHeader.h +++ b/test/Modules/Inputs/PR20399/SecondHeader.h @@ -3,11 +3,11 @@ #include "vector" -class Collection { - template struct Address { }; -}; +template +struct Address {}; -template <> struct Collection::Address > - : public Collection::Address::iterator> { }; +template <> +struct Address> + : Address::iterator> {}; #endif diff --git a/test/Modules/Inputs/PR20399/stl_map.h b/test/Modules/Inputs/PR20399/stl_map.h index 11da042534..334f8b308f 100644 --- a/test/Modules/Inputs/PR20399/stl_map.h +++ b/test/Modules/Inputs/PR20399/stl_map.h @@ -1,25 +1,13 @@ -namespace std -{ - template - class reverse_iterator {}; +namespace std { +struct reverse_iterator {}; - template - inline int* - operator-(const int& __x, const reverse_iterator<_Iterator>& __y) {}; +inline void +operator-(int __x, reverse_iterator __y) {} - template - struct _Rb_tree_iterator - { - typedef _Rb_tree_iterator<_Tp> _Self; - }; +template +struct map { + typedef int iterator; - template - class map - { - public: - typedef _Rb_tree_iterator iterator; - - template - friend bool operator<(const map<_K1, _T1>&, const map<_K1, _T1>&); - }; + friend bool operator<(const map &, const map &); +}; } // namespace std diff --git a/test/Modules/Inputs/PR20399/vector b/test/Modules/Inputs/PR20399/vector index 379e4661d3..1e1b6705f5 100644 --- a/test/Modules/Inputs/PR20399/vector +++ b/test/Modules/Inputs/PR20399/vector @@ -1,51 +1,17 @@ -namespace std -{ - template - class vector - { - public: - int* _M_start; - int* _M_end_of_storage; +namespace std { +template +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 - class vector : protected _Bvector_base - { - typedef _Bvector_base _Base; - public: - typedef _Bit_iterator iterator; - - vector() - : _Base() { } - }; +template +struct vector : bit_iterator { + typedef bit_iterator iterator; +}; } // namespace std