OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [20090329-1.C] - Blame information for rev 715

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
 
3
struct input_iterator_tag { };
4
template
5
struct iterator {
6
    typedef _Category iterator_category;
7
};
8
template struct iterator_traits {
9
    typedef typename _Iterator::iterator_category iterator_category;
10
};
11
template struct __lc_rai {
12
    template
13
        static _II1 __newlast1(_II1, _II1 __last1, _II2, _II2) {
14
            return __last1;
15
        }
16
    template
17
        static bool __cnd2(_II __first, _II __last) {
18
            return __first != __last;
19
        }
20
};
21
template
22
bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2,
23
                             _II2 __last2, _Compare __comp) {
24
    typedef typename iterator_traits<_II1>::iterator_category _Category1;
25
    typedef typename iterator_traits<_II2>::iterator_category _Category2;
26
    typedef __lc_rai<_Category1, _Category2> __rai_type;
27
    __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
28
    for (;
29
         __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
30
         ++__first1, ++__first2) {
31
        if (__comp(*__first1, *__first2)) return true;
32
    }
33
}
34
void __assert_fail () throw () __attribute__ ((__noreturn__));
35
template struct BoundsContainer { };
36
template class input_iterator_wrapper : public iterator {
37
public:
38
    typedef BoundsContainer ContainerType;
39
    T* ptr;
40
    ContainerType* SharedInfo;
41
    input_iterator_wrapper(const input_iterator_wrapper& in) : ptr(in.ptr), SharedInfo(in.SharedInfo) { }
42
    bool operator==(const input_iterator_wrapper& in) const {
43
        (static_cast ((SharedInfo != __null
44
                             && SharedInfo == in.SharedInfo)
45
                            ? 0 : (__assert_fail (), 0)));
46
    }
47
    bool operator!=(const input_iterator_wrapper& in) const {
48
        return !(*this == in);
49
    }
50
    T& operator*() const { }
51
    input_iterator_wrapper& operator++() { }
52
};
53
struct X { };
54
bool predicate(const X&, const X&) {
55
    return true;
56
}
57
bool test2(input_iterator_wrapper& x) {
58
    return lexicographical_compare(x, x, x, x, predicate);
59
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.