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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [parse/] [semicolon3.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/45331
2
// { dg-do compile }
3
// { dg-options -std=c++98 }
4
 
5
struct OK1
6
{
7
  int a;
8
} // no complaints
9
  *s5;
10
 
11
struct OK2
12
{
13
  int a;
14
} // no complaints
15
  &s6 = *(new OK2());
16
 
17
struct OK3
18
{
19
  int a;
20
} // no complaints
21
  (s7);
22
 
23
__SIZE_TYPE__
24
test_offsetof (void)
25
{
26
  // no complaints about a missing semicolon
27
  return __builtin_offsetof (struct OK4 { int a; int b; }, b);
28
}
29
 
30
struct OK5
31
{
32
  int a;
33
} ok5_var;                      // no complaints
34
 
35
struct OK6
36
{
37
  int a;
38
} static ok6_var;               // no complaints
39
 
40
class OK7
41
{
42
public:
43
  OK7() { };
44
  int a;
45
} const ok7_var;                // no complaints
46
 
47
class OK8
48
{
49
  int a;
50
} extern ok8_var;               // no complaints
51
 
52
class OK9
53
{
54
  class OK9sub { int a; } mutable ok9sub; // no complaints
55
  int a;
56
};
57
 
58
int
59
autotest (void)
60
{
61
  struct OK10 { int a; } auto ok10 = { 0 }; // no complaints
62
 
63
  return ok10.a;
64
}
65
 
66
struct OK11
67
{
68
  int a;
69
} // no complaints
70
  const *ok11_var;
71
 
72
struct OK12
73
{
74
  int a;
75
} // no complaints
76
  const &ok12_var = *(new OK12());
77
 
78
struct OK13
79
{
80
  int a;
81
} // no complaints
82
  static *ok13_var;
83
 
84
class OK14
85
{
86
  struct OK14sub
87
  {
88
    int a;
89
  } // no complaints
90
    static &ok14_var;
91
};
92
 
93
class OK15
94
{
95
  int a;
96
} typedef tOK15;
97
 
98
class OK16
99
{
100
  int a;
101
} typedef *pOK16;
102
 
103
class OK17
104
{
105
  int a;
106
} typedef &rOK16;
107
 
108
struct E1
109
{
110
  int a;
111
} // { dg-error "after struct definition" }
112
 
113
typedef float BAR;
114
 
115
struct E2
116
{
117
  int a;
118
} // { dg-error "after struct definition" }
119
 
120
const int i0 = 1;
121
 
122
struct E3
123
{
124
  int a;
125
} // { dg-error "after struct definition" }
126
 
127
volatile long l0 = 1;
128
 
129
struct E4
130
{
131
  int a;
132
} // { dg-error "after struct definition" }
133
 
134
extern char c0;
135
 
136
struct E5
137
{
138
  int a;
139
} // { dg-error "after struct definition" }
140
 
141
static wchar_t wc0;
142
 
143
struct E6
144
{
145
  int a;
146
} // { dg-error "after struct definition" }
147
 
148
bool b0;
149
 
150
class E7
151
{
152
  int a;
153
} // { dg-error "after class definition" }
154
 
155
extern double d0;
156
 
157
class E8
158
{
159
  int a;
160
} // { dg-error "after class definition" }
161
 
162
inline short f(void)
163
{
164
  return 2;
165
}
166
 
167
class E9
168
{
169
  int a;
170
} // { dg-error "after class definition" }
171
 
172
class D0
173
{
174
  int a;
175
};
176
 
177
class E10
178
{
179
  int a;
180
} // { dg-error "after class definition" }
181
 
182
extern class D0 &f0 (void);
183
 
184
class E11
185
{
186
  int a;
187
} // { dg-error "after class definition" }
188
 
189
const struct E6 *f1 (void) { return 0; }
190
 
191
union U0 {
192
  int i;
193
  double d;
194
};
195
 
196
class E12
197
{
198
  int a;
199
} // { dg-error "after class definition" }
200
 
201
const union U0 *f2 (void) { return 0; }
202
 
203
enum e {
204
  U, V
205
};
206
 
207
class E13
208
{
209
  int a;
210
} // { dg-error "after class definition" }
211
 
212
static enum e f3 (void) { return U; }
213
 
214
union E14
215
{
216
  int i;
217
  double d;
218
} // { dg-error "after union definition" }
219
 
220
unsigned int i1 = 2;
221
 
222
union E15
223
{
224
  int i;
225
  double d;
226
} // { dg-error "after union definition" }
227
 
228
signed long l1 = 3;
229
 
230
class E16
231
{
232
  class sub0 { int a; }         // { dg-error "after class definition" }
233
    virtual int f2 (void);
234
} // { dg-error "after class definition" }
235
 
236
class E17
237
{
238
  class sub0 { int a; }         // { dg-error "after class definition" }
239
    mutable int i;
240
} // { dg-error "after class definition" }
241
 
242
class E18
243
{
244
  int a;
245
} // { dg-error "after class definition" }
246
 
247
typedef int E18int;
248
 
249
/* This was the original test from the PR.  */
250
 
251
class C0
252
{
253
public:
254
 int a;
255
} // { dg-error "after class definition" }
256
 
257
const int foo(const C0 &x)
258
{
259
 return x.a;
260
}

powered by: WebSVN 2.1.0

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