comparison gcc/testsuite/g++.dg/debug/pr71432.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fcompare-debug" } */
3 /* { dg-xfail-if "" { powerpc-ibm-aix* } } */
4
5 namespace std
6 {
7 typedef long unsigned int size_t;
8 inline namespace __cxx11
9 {
10 } }
11
12 extern "C++"
13 {
14 namespace std
15 {
16 template < typename _Tp > struct __is_char
17 {
18 };
19 template <> struct __is_char <char >
20 {
21 enum
22 { __value = 1 };
23 };
24 } namespace __gnu_cxx
25 {
26 template < bool, typename > struct __enable_if
27 {
28 };
29 template < typename _Tp > struct __enable_if <true, _Tp >
30 {
31 typedef _Tp __type;
32 };
33 }
34 }
35
36 namespace __gnu_cxx
37 {
38 template < typename _Tp > class new_allocator
39 {
40 };
41 }
42
43 namespace std
44 {
45 template < typename _Tp > using __allocator_base =
46 __gnu_cxx::new_allocator < _Tp >;
47 template < typename _Tp > class allocator:public __allocator_base < _Tp >
48 {
49 };
50 template < typename _Alloc > struct allocator_traits
51 {
52 };
53 template < typename _Tp > struct allocator_traits <allocator < _Tp >>
54 {
55 using size_type = std::size_t;
56 template < typename _Up > using rebind_alloc = allocator < _Up >;
57 };
58 }
59
60 namespace __gnu_cxx
61 {
62 template < typename _Alloc > struct __alloc_traits:std::allocator_traits <_Alloc >
63 {
64 typedef std::allocator_traits < _Alloc > _Base_type;
65 template < typename _Tp > struct rebind
66 {
67 typedef typename _Base_type::template rebind_alloc < _Tp > other;
68 };
69 };
70 }
71
72 namespace std
73 {
74 template < class _CharT > struct char_traits;
75 namespace __cxx11
76 {
77 template < typename _CharT, typename _Traits =
78 char_traits < _CharT >, typename _Alloc =
79 allocator < _CharT > >class basic_string;
80 typedef basic_string < char >string;
81 }
82 }
83
84 namespace std
85 {
86 template <> struct char_traits <char >
87 {
88 typedef char char_type;
89 static int compare (const char_type * __s1, const char_type * __s2,
90 size_t __n)
91 {
92 return __builtin_memcmp (__s1, __s2, __n);
93 }
94 };
95
96 namespace __cxx11
97 {
98 template < typename _CharT, typename _Traits, typename _Alloc >
99 class basic_string
100 {
101 typedef typename __gnu_cxx::__alloc_traits <_Alloc >::template rebind < _CharT >::other _Char_alloc_type;
102 typedef __gnu_cxx::__alloc_traits < _Char_alloc_type > _Alloc_traits;
103 typedef typename _Alloc_traits::size_type size_type;
104
105 public:
106 size_type size ()const noexcept
107 {
108 }
109 const _CharT *data () const noexcept
110 {
111 }
112 };
113 }
114
115 template < typename _CharT > inline typename __gnu_cxx::__enable_if <
116 __is_char < _CharT >::__value,
117 bool >::__type operator== (const basic_string < _CharT > &__lhs,
118 const basic_string < _CharT > &__rhs) noexcept
119 {
120 return !std::char_traits < _CharT >::compare (__lhs.data (),
121 __rhs.data (),
122 __lhs.size ());
123 }
124 };
125
126 class CLIParameterType
127 {
128 const std::string & getSwitchOption (unsigned int i) const
129 {
130 } unsigned int getSwitchOptionCount () const
131 {
132 } int checkSwitched (const std::string & value) const;
133 };
134
135 int
136 CLIParameterType::checkSwitched (const std::string & value) const
137 {
138 int contains = false;
139 for (unsigned int i = 0; !contains && i < getSwitchOptionCount () ;)
140 contains = getSwitchOption (i) == value;
141 }