Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr58371.C
blobcfcf677e3d0b531b2c1122920d26a9ce4987a7da
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-additional-options "-Wno-return-type" } */
6 typedef int size_t;
7 namespace {
8 template < typename > struct char_traits;
10 namespace __gnu_cxx {
11 template < typename > class new_allocator {
14 namespace std {
15 template < typename _Tp > class allocator:__gnu_cxx::new_allocator < _Tp > {
16 public:
17   size_t size_type;
18   typedef _Tp & const_reference;
19   template < typename > struct rebind {
20     typedef allocator other;
21   };
24 namespace __gnu_cxx {
25 template < typename _Alloc > struct __alloc_traits {
26   typedef typename _Alloc::const_reference const_reference;
27   template < typename _Tp > struct rebind {
28     typedef typename _Alloc::template rebind < _Tp >::other other;
29   };
32 namespace std {
33 struct __numeric_limits_base {
35 template < typename _Tp > struct numeric_limits:__numeric_limits_base {
36   static _Tp max () {
37   }
39 template < typename _Tp, typename _Alloc > struct _Vector_base {
40   typedef typename __gnu_cxx::__alloc_traits < _Alloc >::template rebind <
41   _Tp >::other _Tp_alloc_type;
43 template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:_Vector_base < _Tp,
44   _Alloc
45     > {
46   typedef _Vector_base < _Tp, _Alloc > _Base;
47   typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
48   typedef __gnu_cxx::__alloc_traits < _Tp_alloc_type > _Alloc_traits;
49 public:
50   _Tp value_type;
51   typedef typename _Alloc_traits::const_reference const_reference;
52   typedef size_t size_type;
53   size_type size () {
54   } const_reference operator[] (size_type) {
55   }
57 template < typename _CharT, typename =
58 char_traits < _CharT > >class basic_ostream;
59 typedef basic_ostream < int >ostream;
60 class ios_base {
62 template < typename, typename > class basic_ios:ios_base {
64 template < typename _CharT, typename _Traits > class basic_ostream:basic_ios < _CharT,
65   _Traits
66     > {
67 public:
68   _CharT char_type;
69   typedef basic_ostream __ostream_type;
70   __ostream_type & operator<< (const void *) {
71   }
74 namespace logging {
75 int GetMinLogLevel ();
76 typedef int LogSeverity;
77 LogSeverity LOG_ERROR_REPORT;
78 LogSeverity LOG_DCHECK;
79 class LogMessage {
80 public:
81   LogMessage (const char *, int, LogSeverity);
82   std::ostream & stream () {
83   }
85 class LogMessageVoidify {
86 public:
87   LogMessageVoidify () {
88   } void operator& (std::ostream &) {
89   }
92 namespace base {
93 namespace internal {
94 class WeakPtrBase {
96 class SupportsWeakPtrBase {
98 } template < typename T > class WeakPtr:internal::WeakPtrBase {
99 public:
100   WeakPtr () :ptr_ () {
101   } T *operator-> () {
102     logging:0 &&
103     logging::LOG_DCHECK >=
104     logging::GetMinLogLevel () ? (void) 0 : logging::
105     LogMessageVoidify () & logging::
106     LogMessage ("../../base/memory/weak_ptr.h", 0,
107                 logging::LOG_ERROR_REPORT).stream () << ". ";
108   } T *ptr_;
110 template < class > class SupportsWeakPtr:internal::SupportsWeakPtrBase {
113 template < class ObserverType > class ObserverListBase:base::SupportsWeakPtr < ObserverListBase < ObserverType >
114     > {
115 public:
116   class Iterator {
117   public:
118     Iterator (ObserverListBase & list) :max_index_ (0 ? std::numeric_limits <
119           size_t >::max () : list.observers_.
120           size () ) {
121     } ObserverType *
122     GetNext () {
123       ListType & observers = list_->observers_;
124       if (observers[0])
125         ++index_;
126     }
127     base::WeakPtr < ObserverListBase > list_;
128     size_t
129     index_;
130     size_t
131     max_index_;
132   };
133   typedef
134   std::vector <
135   ObserverType * >
136   ListType;
137   ListType
138   observers_;
140 template < class ObserverType, bool > class ObserverList:public ObserverListBase <
141     ObserverType > {
143 namespace
144     ProxyPrefs {
145 enum ConfigState
146 { };
148 namespace
149     net {
150 class
151     ProxyConfig {
153 class
154     ProxyConfigService {
155 public:
156   enum ConfigAvailability
157   { };
158   class
159       Observer {
160   public:
161     Observer () {
162     } virtual void
163     OnProxyConfigChanged (const ProxyConfig &, ConfigAvailability) = 0;
164   };
165   virtual void
166   OnLazyPoll () {
167   }
170 class
171   ChromeProxyConfigService:
172   net::ProxyConfigService,
173     net::ProxyConfigService::Observer {
174   ConfigAvailability
175   GetLatestProxyConfig (net::ProxyConfig *);
176   void
177   UpdateProxyConfig (ProxyPrefs::ConfigState, const net::ProxyConfig &);
178   void
179   OnProxyConfigChanged (const net::ProxyConfig &, ConfigAvailability);
180   ObserverList <
181   net::ProxyConfigService::Observer,
182       0 >
183       observers_;
185 void
186 ChromeProxyConfigService::UpdateProxyConfig (ProxyPrefs::ConfigState,
187     const net::ProxyConfig &) {
188   net::ProxyConfig new_config;
189   ConfigAvailability availability = GetLatestProxyConfig (0);
190 net:
191   ProxyConfigService::Observer * obs;
192   obs->OnProxyConfigChanged (new_config, availability);
194 void
195 ChromeProxyConfigService::OnProxyConfigChanged (const net::ProxyConfig &,
196     ConfigAvailability
197     availability) {
198   net::ProxyConfig actual_config;
199   ObserverListBase <
200   net::ProxyConfigService::Observer >::Iterator it (observers_);
201 net:
202   ProxyConfigService::Observer * obs;
203   if (it.GetNext () )
204     obs->OnProxyConfigChanged (actual_config, availability);