summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr57235.C
blob: 8a9e522a36ad54cb936a7fd688a99481e21f7967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// { dg-do compile }
// { dg-additional-options "-Wno-return-type" }

namespace std
{
  template < class _Elem > struct char_traits
  {
  };
  struct _Container_base
  {
  };
    template < class _Ty > struct _Allocator_base
  {
  };
    template < class _Ty > class allocator:public _Allocator_base < _Ty >
  {
  };
  class _String_base:public _Container_base
  {
  };
template < class _Ty, class _Alloc > class _String_val:public _String_base
  {
  };
template < class _Elem, class _Traits, class _Ax > class basic_string:public _String_val < _Elem,
    _Ax
    >
  {
  public:typedef basic_string < _Elem, _Traits, _Ax > _Myt;
    typedef _String_val < _Elem, _Ax > _Mybase;
    basic_string (const _Elem * _Ptr):_Mybase ()
    {
    }
  };
  typedef basic_string < char, char_traits < char >,
    allocator < char > >string;
}


namespace google
{
  namespace protobuf
  {
    namespace internal
    {
      template < class C > class scoped_ptr
      {
      public:typedef C element_type;
      explicit scoped_ptr (C * p = __null):ptr_ (p)
	{
	}
	 ~scoped_ptr ()
	{
	  delete ptr_;
	}
	C *get () const
	{
	  return ptr_;
	}
      private:  C * ptr_;
      };
    }
    using internal::scoped_ptr;
    enum LogLevel
    {
      LOGLEVEL_INFO, LOGLEVEL_WARNING, LOGLEVEL_ERROR, LOGLEVEL_FATAL,
	LOGLEVEL_DFATAL = LOGLEVEL_ERROR
    };
    namespace internal
    {
      class LogMessage
      {
      public:LogMessage (LogLevel level, const char *filename,
		    int line);
	 ~LogMessage ();
	  LogMessage & operator<< (const std::string & value);
      };
      class LogFinisher
      {
      public:void operator= (LogMessage & other);
      };
    }
    using namespace std;
    class Descriptor
    {
    };
    class FieldDescriptor
    {
    public:
      const Descriptor *message_type () const;
      string DebugString () const;
    };
    class MessageLite
    {
    };
    class Message:public MessageLite
    {
    public:inline Message ()
      {
      }
      virtual ~ Message ();
      virtual Message *New () const = 0;
    };
    class MessageFactory
    {
    };
    class UnknownFieldSet
    {
    };
    class DynamicMessageFactory:public MessageFactory
    {
    public:DynamicMessageFactory ();
      const Message *GetPrototype (const Descriptor * type);
    };
    namespace io
    {
      class ErrorCollector
      {
      public:inline ErrorCollector ()
	{
	}
	virtual ~ ErrorCollector ();
      };
    }
    class DescriptorBuilder
    {
      class OptionInterpreter
      {
	bool SetAggregateOption (const FieldDescriptor * option_field,
				 UnknownFieldSet * unknown_fields);
	DynamicMessageFactory dynamic_factory_;
      };
    };
    namespace
    {
      class AggregateErrorCollector:public io::ErrorCollector
      {
      };
    }
    bool DescriptorBuilder::OptionInterpreter::
      SetAggregateOption (const FieldDescriptor * option_field,
			  UnknownFieldSet * unknown_fields)
    {
      const Descriptor *type = option_field->message_type ();
      scoped_ptr < Message >
	dynamic (dynamic_factory_.GetPrototype (type)->New ());
      !(!(dynamic.get () !=
	  __null)) ? (void) 0 : ::google::protobuf::internal::
	LogFinisher () =::google::protobuf::internal::LogMessage (::google::
								  protobuf::
								  LOGLEVEL_FATAL,
								  "descriptor.cc",
								  4396) <<
	option_field->DebugString ();
      AggregateErrorCollector collector;
    }
  }
}