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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rv6n.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// I, Howard Hinnant, hereby place this code in the public domain.
2
 
3
// Test overload resolution among reference types
4
 
5
// { dg-do compile }
6
// { dg-options "-std=c++0x" }
7
 
8
template  struct sa;
9
template <> struct sa {};
10
 
11
struct one   {char x[1];};
12
struct two   {char x[2];};
13
struct three {char x[3];};
14
struct four  {char x[4];};
15
struct five  {char x[5];};
16
struct six   {char x[6];};
17
struct seven {char x[7];};
18
struct eight {char x[8];};
19
 
20
struct A
21
{
22
    A();
23
    A(const volatile A&&);
24
};
25
 
26
               A    source();
27
const          A  c_source();
28
      volatile A  v_source();
29
const volatile A cv_source();
30
 
31
// 6 at a time
32
 
33
one   sink_6_123456(               A&);  // { dg-message "one sink_6_123456|no known conversion" }
34
two   sink_6_123456(const          A&);  // { dg-message "note" }
35
three sink_6_123456(volatile       A&);  // { dg-message "note" }
36
four  sink_6_123456(const volatile A&);  // { dg-message "note" }
37
five  sink_6_123456(               A&&);  // { dg-message "note" }
38
six   sink_6_123456(const          A&&);  // { dg-message "note" }
39
 
40
int test6_123456()
41
{
42
                   A a;
43
    const          A ca = a; // { dg-error "deleted" }
44
          volatile A va;
45
    const volatile A cva = a; // { dg-error "deleted" }
46
    sink_6_123456(v_source());   // { dg-error "no match" }
47
    // { dg-message "candidate" "candidate note" { target *-*-* } 46 }
48
    sink_6_123456(cv_source());  // { dg-error "no match" }
49
    // { dg-message "candidate" "candidate note" { target *-*-* } 48 }
50
    return 0;
51
}
52
 
53
one   sink_6_123457(               A&);  // { dg-message "one sink_6_123457|no known conversion" }
54
two   sink_6_123457(const          A&);  // { dg-message "note" }
55
three sink_6_123457(volatile       A&);  // { dg-message "note" }
56
four  sink_6_123457(const volatile A&);  // { dg-message "note" }
57
five  sink_6_123457(               A&&);  // { dg-message "note" }
58
seven sink_6_123457(volatile       A&&);  // { dg-message "note" }
59
 
60
int test6_123457()
61
{
62
                   A a;
63
    const          A ca = a; // { dg-error "deleted" }
64
          volatile A va;
65
    const volatile A cva = a; // { dg-error "deleted" }
66
    sink_6_123457(cv_source());  // { dg-error "no match" }
67
    // { dg-message "candidate" "candidate note" { target *-*-* } 66 }
68
    return 0;
69
}
70
 
71
two   sink_6_235678(const          A&);  // { dg-message "note" }
72
three sink_6_235678(volatile       A&);  // { dg-message "note" }
73
five  sink_6_235678(               A&&);  // { dg-message "note" }
74
six   sink_6_235678(const          A&&);  // { dg-message "note" }
75
seven sink_6_235678(volatile       A&&);  // { dg-message "note" }
76
eight sink_6_235678(const volatile A&&);  // { dg-message "" }
77
 
78
int test6_235678()
79
{
80
                   A a;
81
    const          A ca = a; // { dg-error "deleted" }
82
          volatile A va;
83
    const volatile A cva = a; // { dg-error "deleted" }
84
    sink_6_235678(a);  // { dg-error "ambiguous" }
85
    // { dg-message "candidate" "candidate note" { target *-*-* } 84 }
86
    sink_6_235678(cva);         // { dg-error "lvalue" }
87
    return 0;
88
}
89
 
90
two   sink_6_234678(const          A&);  // { dg-message "note" }
91
three sink_6_234678(volatile       A&);  // { dg-message "note" }
92
four  sink_6_234678(const volatile A&);  // { dg-message "note" }
93
six   sink_6_234678(const          A&&);  // { dg-message "note" }
94
seven sink_6_234678(volatile       A&&);  // { dg-message "note" }
95
eight sink_6_234678(const volatile A&&);  // { dg-message "note" }
96
 
97
int test6_234678()
98
{
99
                   A a;
100
    const          A ca = a; // { dg-error "deleted" }
101
          volatile A va;
102
    const volatile A cva = a; // { dg-error "deleted" }
103
    sink_6_234678(a);         // { dg-error "ambiguous" }
104
    // { dg-message "candidate" "candidate note" { target *-*-* } 103 }
105
    sink_6_234678(source());  // { dg-error "ambiguous" }
106
    // { dg-message "candidate" "candidate note" { target *-*-* } 105 }
107
    return 0;
108
}
109
 
110
two   sink_6_234578(const          A&);  // { dg-message "note" }
111
three sink_6_234578(volatile       A&);  // { dg-message "note" }
112
four  sink_6_234578(const volatile A&);  // { dg-message "note" }
113
five  sink_6_234578(               A&&);  // { dg-message "note" }
114
seven sink_6_234578(volatile       A&&);  // { dg-message "note" }
115
eight sink_6_234578(const volatile A&&);  // { dg-message "note" }
116
 
117
int test6_234578()
118
{
119
                   A a;
120
    const          A ca = a; // { dg-error "deleted" }
121
          volatile A va;
122
    const volatile A cva = a; // { dg-error "deleted" }
123
    sink_6_234578(a);  // { dg-error "ambiguous" }
124
    // { dg-message "candidate" "candidate note" { target *-*-* } 123 }
125
    return 0;
126
}
127
 
128
two   sink_6_234568(const          A&);  // { dg-message "note" }
129
three sink_6_234568(volatile       A&);  // { dg-message "note" }
130
four  sink_6_234568(const volatile A&);  // { dg-message "note" }
131
five  sink_6_234568(               A&&);  // { dg-message "note" }
132
six   sink_6_234568(const          A&&);  // { dg-message "note" }
133
eight sink_6_234568(const volatile A&&);  // { dg-message "note" }
134
 
135
int test6_234568()
136
{
137
                   A a;
138
    const          A ca = a; // { dg-error "deleted" }
139
          volatile A va;
140
    const volatile A cva = a; // { dg-error "deleted" }
141
    sink_6_234568(a);  // { dg-error "ambiguous" }
142
    // { dg-message "candidate" "candidate note" { target *-*-* } 141 }
143
    return 0;
144
}
145
 
146
two   sink_6_234567(const          A&);  // { dg-message "two sink_6_234567|no known conversion" }
147
three sink_6_234567(volatile       A&);  // { dg-message "note" }
148
four  sink_6_234567(const volatile A&);  // { dg-message "note" }
149
five  sink_6_234567(               A&&);  // { dg-message "note" }
150
six   sink_6_234567(const          A&&);  // { dg-message "note" }
151
seven sink_6_234567(volatile       A&&);  // { dg-message "note" }
152
 
153
int test6_234567()
154
{
155
                   A a;
156
    const          A ca = a; // { dg-error "deleted" }
157
          volatile A va;
158
    const volatile A cva = a; // { dg-error "deleted" }
159
    sink_6_234567(a);            // { dg-error "ambiguous" }
160
    // { dg-message "candidate" "candidate note" { target *-*-* } 159 }
161
    sink_6_234567(cv_source());  // { dg-error "no match" }
162
    // { dg-message "candidate" "candidate note" { target *-*-* } 161 }
163
    return 0;
164
}
165
 
166
one   sink_6_134678(               A&);
167
three sink_6_134678(volatile       A&);
168
four  sink_6_134678(const volatile A&);
169
six   sink_6_134678(const          A&&);  // { dg-message "note" }
170
seven sink_6_134678(volatile       A&&);  // { dg-message "note" }
171
eight sink_6_134678(const volatile A&&);  // { dg-message "note" }
172
 
173
int test6_134678()
174
{
175
                   A a;
176
    const          A ca = a; // { dg-error "deleted" }
177
          volatile A va;
178
    const volatile A cva = a; // { dg-error "deleted" }
179
    sink_6_134678(source());  // { dg-error "ambiguous" }
180
    // { dg-message "candidate" "candidate note" { target *-*-* } 179 }
181
    return 0;
182
}
183
 
184
one   sink_6_124678(               A&);
185
two   sink_6_124678(const          A&);  // { dg-message "note" }
186
four  sink_6_124678(const volatile A&);
187
six   sink_6_124678(const          A&&);  // { dg-message "note" }
188
seven sink_6_124678(volatile       A&&);  // { dg-message "note" }
189
eight sink_6_124678(const volatile A&&);  // { dg-message "note" }
190
 
191
int test6_124678()
192
{
193
                   A a;
194
    const          A ca = a; // { dg-error "deleted" }
195
          volatile A va;
196
    const volatile A cva = a; // { dg-error "deleted" }
197
    sink_6_124678(source());  // { dg-error "ambiguous" }
198
    // { dg-message "candidate" "candidate note" { target *-*-* } 197 }
199
    return 0;
200
}
201
 
202
one   sink_6_123678(               A&);
203
two   sink_6_123678(const          A&);  // { dg-message "note" }
204
three sink_6_123678(volatile       A&);
205
six   sink_6_123678(const          A&&);  // { dg-message "note" }
206
seven sink_6_123678(volatile       A&&);  // { dg-message "note" }
207
eight sink_6_123678(const volatile A&&);  // { dg-message "" }
208
 
209
int test6_123678()
210
{
211
                   A a;
212
    const          A ca = a; // { dg-error "deleted" }
213
          volatile A va;
214
    const volatile A cva = a; // { dg-error "deleted" }
215
    sink_6_123678(cva);         // { dg-error "lvalue" }
216
    sink_6_123678(source());  // { dg-error "ambiguous" }
217
    // { dg-message "candidate" "candidate note" { target *-*-* } 216 }
218
    return 0;
219
}
220
 
221
one   sink_6_123567(               A&);  // { dg-message "one sink_6_123567|no known conversion" }
222
two   sink_6_123567(const          A&);  // { dg-message "note" }
223
three sink_6_123567(volatile       A&);  // { dg-message "note" }
224
five  sink_6_123567(               A&&);  // { dg-message "note" }
225
six   sink_6_123567(const          A&&);  // { dg-message "note" }
226
seven sink_6_123567(volatile       A&&);  // { dg-message "note" }
227
 
228
int test6_123567()
229
{
230
                   A a;
231
    const          A ca = a; // { dg-error "deleted" }
232
          volatile A va;
233
    const volatile A cva = a; // { dg-error "deleted" }
234
    sink_6_123567(cva);          // { dg-error "no match" }
235
    // { dg-message "candidate" "candidate note" { target *-*-* } 234 }
236
    sink_6_123567(cv_source());  // { dg-error "no match" }
237
    // { dg-message "candidate" "candidate note" { target *-*-* } 236 }
238
    return 0;
239
}
240
 
241
one   sink_6_123568(               A&);
242
two   sink_6_123568(const          A&);
243
three sink_6_123568(volatile       A&);
244
five  sink_6_123568(               A&&);
245
six   sink_6_123568(const          A&&);
246
eight sink_6_123568(const volatile A&&); // { dg-message "" }
247
 
248
int test6_123568()
249
{
250
                   A a;
251
    const          A ca = a; // { dg-error "deleted" }
252
          volatile A va;
253
    const volatile A cva = a; // { dg-error "deleted" }
254
    sink_6_123568(cva); // { dg-error "lvalue" }
255
    return 0;
256
}
257
 
258
one   sink_6_123578(               A&);
259
two   sink_6_123578(const          A&);
260
three sink_6_123578(volatile       A&);
261
five  sink_6_123578(               A&&);
262
seven sink_6_123578(volatile       A&&);
263
eight sink_6_123578(const volatile A&&); // { dg-message "" }
264
 
265
int test6_123578()
266
{
267
                   A a;
268
    const          A ca = a; // { dg-error "deleted" }
269
          volatile A va;
270
    const volatile A cva = a; // { dg-error "deleted" }
271
    sink_6_123578(cva);         // { dg-error "lvalue" }
272
    return 0;
273
}
274
 
275
one   sink_6_123467(               A&);  // { dg-message "one sink_6_123467|no known conversion" }
276
two   sink_6_123467(const          A&);  // { dg-message "note" }
277
three sink_6_123467(volatile       A&);  // { dg-message "note" }
278
four  sink_6_123467(const volatile A&);  // { dg-message "note" }
279
six   sink_6_123467(const          A&&);  // { dg-message "note" }
280
seven sink_6_123467(volatile       A&&);  // { dg-message "note" }
281
 
282
int test6_123467()
283
{
284
                   A a;
285
    const          A ca = a; // { dg-error "deleted" }
286
          volatile A va;
287
    const volatile A cva = a; // { dg-error "deleted" }
288
    sink_6_123467(source());     // { dg-error "ambiguous" }
289
    // { dg-message "candidate" "candidate note" { target *-*-* } 288 }
290
    sink_6_123467(cv_source());  // { dg-error "no match" }
291
    // { dg-message "candidate" "candidate note" { target *-*-* } 290 }
292
    return 0;
293
}
294
 
295
one   sink_6_124567(               A&);  // { dg-message "one sink_6_124567|no known conversion" }
296
two   sink_6_124567(const          A&);  // { dg-message "note" }
297
four  sink_6_124567(const volatile A&);  // { dg-message "note" }
298
five  sink_6_124567(               A&&);  // { dg-message "note" }
299
six   sink_6_124567(const          A&&);  // { dg-message "note" }
300
seven sink_6_124567(volatile       A&&);  // { dg-message "note" }
301
 
302
int test6_124567()
303
{
304
                   A a;
305
    const          A ca = a; // { dg-error "deleted" }
306
          volatile A va;
307
    const volatile A cva = a; // { dg-error "deleted" }
308
    sink_6_124567(cv_source());  // { dg-error "no match" }
309
    // { dg-message "candidate" "candidate note" { target *-*-* } 308 }
310
    return 0;
311
}
312
 
313
one   sink_6_125678(               A&);
314
two   sink_6_125678(const          A&);
315
five  sink_6_125678(               A&&);
316
six   sink_6_125678(const          A&&);
317
seven sink_6_125678(volatile       A&&); // { dg-message "" }
318
eight sink_6_125678(const volatile A&&); // { dg-message "" }
319
 
320
int test6_125678()
321
{
322
                   A a;
323
    const          A ca = a; // { dg-error "deleted" }
324
          volatile A va;
325
    const volatile A cva = a; // { dg-error "deleted" }
326
    sink_6_125678(va);          // { dg-error "lvalue" }
327
    sink_6_125678(cva);         // { dg-error "lvalue" }
328
    return 0;
329
}
330
 
331
one   sink_6_134567(               A&);  // { dg-message "one sink_6_134567|no known conversion" }
332
three sink_6_134567(volatile       A&);  // { dg-message "note" }
333
four  sink_6_134567(const volatile A&);  // { dg-message "note" }
334
five  sink_6_134567(               A&&);  // { dg-message "note" }
335
six   sink_6_134567(const          A&&);  // { dg-message "note" }
336
seven sink_6_134567(volatile       A&&);  // { dg-message "note" }
337
 
338
int test6_134567()
339
{
340
                   A a;
341
    const          A ca = a; // { dg-error "deleted" }
342
          volatile A va;
343
    const volatile A cva = a; // { dg-error "deleted" }
344
    sink_6_134567(cv_source());  // { dg-error "no match" }
345
    // { dg-message "candidate" "candidate note" { target *-*-* } 344 }
346
    return 0;
347
}
348
 
349
one   sink_6_135678(               A&);
350
three sink_6_135678(volatile       A&);
351
five  sink_6_135678(               A&&);
352
six   sink_6_135678(const          A&&); // { dg-message "" }
353
seven sink_6_135678(volatile       A&&);
354
eight sink_6_135678(const volatile A&&); // { dg-message "" }
355
 
356
int test6_135678()
357
{
358
                   A a;
359
    const          A ca = a; // { dg-error "deleted" }
360
          volatile A va;
361
    const volatile A cva = a; // { dg-error "deleted" }
362
    sink_6_135678(ca);          // { dg-error "lvalue" }
363
    sink_6_135678(cva);         // { dg-error "lvalue" }
364
    return 0;
365
}
366
 
367
int main()
368
{
369
    return test6_235678() + test6_234678() + test6_234578() + test6_234568() +
370
           test6_234567() + test6_134678() + test6_124678() + test6_123678() +
371
           test6_123567();
372
}

powered by: WebSVN 2.1.0

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