diff options
author | Ben Cheng <bccheng@google.com> | 2014-04-22 13:33:12 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-04-22 13:33:12 -0700 |
commit | e3cc64dec20832769406aa38cde83c7dd4194bf4 (patch) | |
tree | ef8e39be37cfe0cb69d850043b7924389ff17164 /gcc-4.9/gcc/testsuite/g++.dg/torture/pr60659.C | |
parent | f33c7b3122b1d7950efa88067c9a156229ba647b (diff) | |
download | toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.gz toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.bz2 toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.zip |
[4.9] GCC 4.9.0 official release refresh
Change-Id: Ic99a7da8b44b789a48aeec93b33e93944d6e6767
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/torture/pr60659.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/torture/pr60659.C | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60659.C b/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60659.C new file mode 100644 index 000000000..f0158a522 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60659.C @@ -0,0 +1,58 @@ +// { dg-do compile } +template <typename _InputIterator> void __distance (_InputIterator); +template <typename _InputIterator> +void distance (_InputIterator, _InputIterator p2) +{ + __distance (p2); +} + +namespace boost +{ +template <class Iterator> struct A +{ + typedef typename Iterator::difference_type type; +}; +template <class T> typename T::const_iterator end (T &); +template <class T> typename T::const_iterator begin (T &); +template <class T> struct D : A<typename T::const_iterator> +{ +}; +template <class T> typename D<T>::type distance (const T &p1) +{ + distance (boost::begin (p1), boost::end (p1)); + return 0; +} +template <class IteratorT> class B +{ +public: + typedef B type; + typedef IteratorT const_iterator; +}; +} + +typedef int storage_t[]; +struct F; +template <template <typename> class> struct G +{ + G (const G &p1) { p1.m_fn1 ().m_fn1 (0); } + const F &m_fn1 () const + { + const void *a; + a = &data_m; + return *static_cast<const F *>(a); + } + storage_t *data_m; +}; + +struct F +{ + virtual F *m_fn1 (void *) const; +}; +template <typename> struct H; +struct C : G<H> +{ + typedef int difference_type; +}; +boost::B<C> AllTransVideos (); +int b = boost::distance (AllTransVideos ()); + |