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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr31863.C] - Blame information for rev 307

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

Line No. Rev Author Line
1 301 jeremybenn
/* { dg-do link } */
2
/* { dg-timeout-factor 2.0 } */
3
 
4
namespace Loki
5
{
6
    class NullType {};
7
    template 
8
    struct Typelist
9
    {
10
       typedef T Head;
11
       typedef U Tail;
12
    };
13
 
14
 
15
 
16
    namespace TL
17
    {
18
        template
19
        <
20
                typename T1 = NullType, typename T2 = NullType, typename T3 =
21
NullType,
22
                typename T4 = NullType, typename T5 = NullType, typename T6 =
23
NullType,
24
                typename T7 = NullType, typename T8 = NullType, typename T9 =
25
NullType,
26
                typename T10 = NullType, typename T11 = NullType, typename T12
27
= NullType,
28
                typename T13 = NullType, typename T14 = NullType, typename T15
29
= NullType,
30
                typename T16 = NullType, typename T17 = NullType, typename T18
31
= NullType,
32
                typename T19 = NullType, typename T20 = NullType, typename T21
33
= NullType,
34
                typename T22 = NullType, typename T23 = NullType, typename T24
35
= NullType,
36
                typename T25 = NullType, typename T26 = NullType, typename T27
37
= NullType,
38
                typename T28 = NullType, typename T29 = NullType, typename T30
39
= NullType,
40
                typename T31 = NullType, typename T32 = NullType, typename T33
41
= NullType,
42
                typename T34 = NullType, typename T35 = NullType, typename T36
43
= NullType,
44
                typename T37 = NullType, typename T38 = NullType, typename T39
45
= NullType,
46
                typename T40 = NullType
47
        >
48
        struct MakeTypelist
49
        {
50
        private:
51
            typedef typename MakeTypelist
52
            <
53
                T2 , T3 , T4 ,
54
                T5 , T6 , T7 ,
55
                T8 , T9 , T10,
56
                T11, T12, T13,
57
                T14, T15, T16,
58
                T17, T18, T19,
59
                T20, T21, T22,
60
                T23, T24, T25,
61
                T26, T27, T28,
62
                T29, T30, T31,
63
                T32, T33, T34,
64
                T35, T36, T37,
65
                T38, T39, T40
66
            >
67
            ::Result TailResult;
68
 
69
        public:
70
            typedef Typelist Result;
71
        };
72
 
73
        template<>
74
        struct MakeTypelist<>
75
        {
76
            typedef NullType Result;
77
        };
78
 
79
    }
80
}
81
template 
82
class Factory;
83
 
84
template 
85
struct Context
86
{
87
    typedef Key KeyType;
88
    enum
89
    {
90
        isWrite = iW
91
    };
92
};
93
 
94
namespace detail
95
{
96
 
97
template 
98
class CreatorUnitBaseImpl
99
{
100
public:
101
    typedef Context Context_;
102
private:
103
    typedef void*(CreatorUnitBaseImpl::*CreateFun)(Context_&, unsigned&, const
104
Key&);
105
    CreateFun createFun_;
106
 
107
protected:
108
    virtual void* createUninitialized () = 0;
109
    template 
110
    void* createImpl (Context_& ctx, unsigned& ver, const Key& k)
111
    {
112
        return createUninitialized();
113
    }
114
private:
115
    CreatorUnitBaseImpl();
116
public:
117
    template 
118
    CreatorUnitBaseImpl (Value*) :
119
        createFun_( &CreatorUnitBaseImpl::template createImpl )
120
    {
121
    }
122
 
123
    virtual ~CreatorUnitBaseImpl () {}
124
 
125
    CreatorUnitBaseImpl(const CreatorUnitBaseImpl& s)
126
        : createFun_(s.createFun_)
127
    {
128
    }
129
 
130
    CreatorUnitBaseImpl& operator=(const CreatorUnitBaseImpl& s)
131
    {
132
        createFun_ = s.createFun_;
133
        return *this;
134
    }
135
    void* create (Context_& ctx, unsigned& ver, const Key& k)
136
    {
137
        return (this->*createFun_)(ctx, ver, k);
138
    }
139
};
140
 
141
template 
142
class Creator : protected CreatorUnitBaseImpl, protected
143
CreatorUnitBaseImpl
144
{
145
public:
146
    typedef void* (*CreatorFun) ();
147
 
148
private:
149
    CreatorFun fun_;
150
protected:
151
    virtual void* createUninitialized ()
152
    {
153
        if (fun_)
154
            return (*fun_)();
155
        return 0;
156
    }
157
private:
158
    Creator ();
159
public:
160
    template 
161
    Creator (CreatorFun f, Value*) :
162
        CreatorUnitBaseImpl((Value*)0),
163
        CreatorUnitBaseImpl((Value*)0),
164
        fun_(f)
165
    {
166
    }
167
 
168
    Creator(const Creator& s) :
169
        CreatorUnitBaseImpl(s),
170
        CreatorUnitBaseImpl(s),
171
        fun_(s.fun_)
172
    {
173
 
174
    }
175
 
176
    Creator& operator=(const Creator& s)
177
    {
178
        CreatorUnitBaseImpl::operator=(s);
179
        CreatorUnitBaseImpl::operator=(s);
180
        fun_ = s.fun_;
181
        return *this;
182
    }
183
 
184
    virtual ~Creator ()
185
    {
186
    }
187
 
188
    template 
189
    void* createObject (Context& ctx, unsigned& ver, const Key& k)
190
    {
191
        void* r = CreatorUnitBaseImpl::create(ctx, ver,
192
k);
193
        return r;
194
    }
195
};
196
 
197
}
198
 
199
template 
200
class Factory
201
{
202
public:
203
    typedef Key KeyType;
204
    typedef void* (*CreatorFun) ();
205
    typedef detail::Creator Creator;
206
public:
207
    Factory () {}
208
    ~Factory () {}
209
 
210
    template 
211
    bool registerCreator (const Key& k, CreatorFun fun)
212
    {
213
        return true;
214
    }
215
    template 
216
    void* createObject (const Key& k, Context& ctx, unsigned& ver)
217
    {
218
        return 0;
219
    }
220
};
221
 
222
template 
223
struct ClassSpec
224
{
225
    typedef Key KeyType;
226
    typedef Base BaseType;
227
    enum {KeyValue = key};
228
};
229
 
230
template 
231
class Serializer;
232
 
233
template 
234
class Serializer >
235
    : public virtual Factory
236
{
237
    typedef Key KeyType;
238
    typedef Base BaseType;
239
    enum {KeyValue = key};
240
    typedef Factory Inherited;
241
    typedef Serializer > SelfType;
242
 
243
    static void* create ()
244
    {
245
        return (void*) (new BaseType);
246
    }
247
public:
248
    Serializer()
249
    {
250
        Inherited::template registerCreator(
251
                KeyValue,
252
                &SelfType::create);
253
    }
254
};
255
 
256
template 
257
class Serializer >:
258
    public Serializer
259
{
260
};
261
 
262
template 
263
class Serializer >:
264
    public virtual Serializer,
265
    public virtual Serializer
266
{
267
};
268
 
269
template 
270
class Serializer : public virtual Factory
271
{
272
};
273
 
274
 
275
 
276
 
277
typedef unsigned KeyType;
278
 
279
 
280
 
281
typedef Factory FactoryType;
282
 
283
typedef KeyType Key;
284
 
285
struct A001
286
{
287
    template 
288
    bool serialize(Context& ctx, unsigned& ver)
289
    {
290
        return true;
291
    }
292
    static Key classId() { return 1; }
293
    static const char* className () {return "A001";}
294
};
295
 
296
struct A002
297
{
298
    template 
299
    bool serialize(Context& ctx, unsigned& ver)
300
    {
301
        return true;
302
    }
303
    static Key classId() { return 2; }
304
    static const char* className () {return "A002";}
305
};
306
 
307
struct A003
308
{
309
    template 
310
    bool serialize(Context& ctx, unsigned& ver)
311
    {
312
        return true;
313
    }
314
    static Key classId() { return 3; }
315
    static const char* className () {return "A003";}
316
};
317
 
318
struct A004
319
{
320
    template 
321
    bool serialize(Context& ctx, unsigned& ver)
322
    {
323
        return true;
324
    }
325
    static Key classId() { return 4; }
326
    static const char* className () {return "A004";}
327
};
328
 
329
struct A005
330
{
331
    template 
332
    bool serialize(Context& ctx, unsigned& ver)
333
    {
334
        return true;
335
    }
336
    static Key classId() { return 5; }
337
    static const char* className () {return "A005";}
338
};
339
 
340
struct A006
341
{
342
    template 
343
    bool serialize(Context& ctx, unsigned& ver)
344
    {
345
        return true;
346
    }
347
    static Key classId() { return 6; }
348
    static const char* className () {return "A006";}
349
};
350
 
351
struct A007
352
{
353
    template 
354
    bool serialize(Context& ctx, unsigned& ver)
355
    {
356
        return true;
357
    }
358
    static Key classId() { return 7; }
359
    static const char* className () {return "A007";}
360
};
361
 
362
struct A008
363
{
364
    template 
365
    bool serialize(Context& ctx, unsigned& ver)
366
    {
367
        return true;
368
    }
369
    static Key classId() { return 8; }
370
    static const char* className () {return "A008";}
371
};
372
 
373
struct A009
374
{
375
    template 
376
    bool serialize(Context& ctx, unsigned& ver)
377
    {
378
        return true;
379
    }
380
    static Key classId() { return 9; }
381
    static const char* className () {return "A009";}
382
};
383
 
384
struct A010
385
{
386
    template 
387
    bool serialize(Context& ctx, unsigned& ver)
388
    {
389
        return true;
390
    }
391
    static Key classId() { return 10; }
392
    static const char* className () {return "A010";}
393
};
394
 
395
struct A011
396
{
397
    template 
398
    bool serialize(Context& ctx, unsigned& ver)
399
    {
400
        return true;
401
    }
402
    static Key classId() { return 11; }
403
    static const char* className () {return "A011";}
404
};
405
 
406
struct A012
407
{
408
    template 
409
    bool serialize(Context& ctx, unsigned& ver)
410
    {
411
        return true;
412
    }
413
    static Key classId() { return 12; }
414
    static const char* className () {return "A012";}
415
};
416
 
417
struct A013
418
{
419
    template 
420
    bool serialize(Context& ctx, unsigned& ver)
421
    {
422
        return true;
423
    }
424
    static Key classId() { return 13; }
425
    static const char* className () {return "A013";}
426
};
427
 
428
struct A014
429
{
430
    template 
431
    bool serialize(Context& ctx, unsigned& ver)
432
    {
433
        return true;
434
    }
435
    static Key classId() { return 14; }
436
    static const char* className () {return "A014";}
437
};
438
 
439
struct A015
440
{
441
    template 
442
    bool serialize(Context& ctx, unsigned& ver)
443
    {
444
        return true;
445
    }
446
    static Key classId() { return 15; }
447
    static const char* className () {return "A015";}
448
};
449
 
450
struct A016
451
{
452
    template 
453
    bool serialize(Context& ctx, unsigned& ver)
454
    {
455
        return true;
456
    }
457
    static Key classId() { return 16; }
458
    static const char* className () {return "A016";}
459
};
460
 
461
struct A017
462
{
463
    template 
464
    bool serialize(Context& ctx, unsigned& ver)
465
    {
466
        return true;
467
    }
468
    static Key classId() { return 17; }
469
    static const char* className () {return "A017";}
470
};
471
 
472
struct A018
473
{
474
    template 
475
    bool serialize(Context& ctx, unsigned& ver)
476
    {
477
        return true;
478
    }
479
    static Key classId() { return 18; }
480
    static const char* className () {return "A018";}
481
};
482
 
483
struct A019
484
{
485
    template 
486
    bool serialize(Context& ctx, unsigned& ver)
487
    {
488
        return true;
489
    }
490
    static Key classId() { return 19; }
491
    static const char* className () {return "A019";}
492
};
493
 
494
struct A020
495
{
496
    template 
497
    bool serialize(Context& ctx, unsigned& ver)
498
    {
499
        return true;
500
    }
501
    static Key classId() { return 20; }
502
    static const char* className () {return "A020";}
503
};
504
 
505
struct A021
506
{
507
    template 
508
    bool serialize(Context& ctx, unsigned& ver)
509
    {
510
        return true;
511
    }
512
    static Key classId() { return 21; }
513
    static const char* className () {return "A021";}
514
};
515
 
516
struct A022
517
{
518
    template 
519
    bool serialize(Context& ctx, unsigned& ver)
520
    {
521
        return true;
522
    }
523
    static Key classId() { return 22; }
524
    static const char* className () {return "A022";}
525
};
526
 
527
struct A023
528
{
529
    template 
530
    bool serialize(Context& ctx, unsigned& ver)
531
    {
532
        return true;
533
    }
534
    static Key classId() { return 23; }
535
    static const char* className () {return "A023";}
536
};
537
 
538
struct A024
539
{
540
    template 
541
    bool serialize(Context& ctx, unsigned& ver)
542
    {
543
        return true;
544
    }
545
    static Key classId() { return 24; }
546
    static const char* className () {return "A024";}
547
};
548
 
549
struct A025
550
{
551
    template 
552
    bool serialize(Context& ctx, unsigned& ver)
553
    {
554
        return true;
555
    }
556
    static Key classId() { return 25; }
557
    static const char* className () {return "A025";}
558
};
559
 
560
struct A026
561
{
562
    template 
563
    bool serialize(Context& ctx, unsigned& ver)
564
    {
565
        return true;
566
    }
567
    static Key classId() { return 26; }
568
    static const char* className () {return "A026";}
569
};
570
 
571
struct A027
572
{
573
    template 
574
    bool serialize(Context& ctx, unsigned& ver)
575
    {
576
        return true;
577
    }
578
    static Key classId() { return 27; }
579
    static const char* className () {return "A027";}
580
};
581
 
582
struct A028
583
{
584
    template 
585
    bool serialize(Context& ctx, unsigned& ver)
586
    {
587
        return true;
588
    }
589
    static Key classId() { return 28; }
590
    static const char* className () {return "A028";}
591
};
592
 
593
struct A029
594
{
595
    template 
596
    bool serialize(Context& ctx, unsigned& ver)
597
    {
598
        return true;
599
    }
600
    static Key classId() { return 29; }
601
    static const char* className () {return "A029";}
602
};
603
 
604
struct A030
605
{
606
    template 
607
    bool serialize(Context& ctx, unsigned& ver)
608
    {
609
        return true;
610
    }
611
    static Key classId() { return 30; }
612
    static const char* className () {return "A030";}
613
};
614
 
615
struct A031
616
{
617
    template 
618
    bool serialize(Context& ctx, unsigned& ver)
619
    {
620
        return true;
621
    }
622
    static Key classId() { return 31; }
623
    static const char* className () {return "A031";}
624
};
625
 
626
struct A032
627
{
628
    template 
629
    bool serialize(Context& ctx, unsigned& ver)
630
    {
631
        return true;
632
    }
633
    static Key classId() { return 32; }
634
    static const char* className () {return "A032";}
635
};
636
 
637
struct A033
638
{
639
    template 
640
    bool serialize(Context& ctx, unsigned& ver)
641
    {
642
        return true;
643
    }
644
    static Key classId() { return 33; }
645
    static const char* className () {return "A033";}
646
};
647
 
648
struct A034
649
{
650
    template 
651
    bool serialize(Context& ctx, unsigned& ver)
652
    {
653
        return true;
654
    }
655
    static Key classId() { return 34; }
656
    static const char* className () {return "A034";}
657
};
658
 
659
struct A035
660
{
661
    template 
662
    bool serialize(Context& ctx, unsigned& ver)
663
    {
664
        return true;
665
    }
666
    static Key classId() { return 35; }
667
    static const char* className () {return "A035";}
668
};
669
 
670
struct A036
671
{
672
    template 
673
    bool serialize(Context& ctx, unsigned& ver)
674
    {
675
        return true;
676
    }
677
    static Key classId() { return 36; }
678
    static const char* className () {return "A036";}
679
};
680
 
681
struct A037
682
{
683
    template 
684
    bool serialize(Context& ctx, unsigned& ver)
685
    {
686
        return true;
687
    }
688
    static Key classId() { return 37; }
689
    static const char* className () {return "A037";}
690
};
691
 
692
struct A038
693
{
694
    template 
695
    bool serialize(Context& ctx, unsigned& ver)
696
    {
697
        return true;
698
    }
699
    static Key classId() { return 38; }
700
    static const char* className () {return "A038";}
701
};
702
 
703
struct A039
704
{
705
    template 
706
    bool serialize(Context& ctx, unsigned& ver)
707
    {
708
        return true;
709
    }
710
    static Key classId() { return 39; }
711
    static const char* className () {return "A039";}
712
};
713
 
714
struct A040
715
{
716
    template 
717
    bool serialize(Context& ctx, unsigned& ver)
718
    {
719
        return true;
720
    }
721
    static Key classId() { return 40; }
722
    static const char* className () {return "A040";}
723
};
724
 
725
Factory& getInstance()
726
{
727
    static Serializer
728
        Loki::TL::MakeTypelist<
729
            ClassSpec,
730
            ClassSpec,
731
            ClassSpec,
732
            ClassSpec,
733
            ClassSpec,
734
            ClassSpec,
735
            ClassSpec,
736
            ClassSpec,
737
            ClassSpec,
738
            ClassSpec,
739
            ClassSpec,
740
            ClassSpec,
741
            ClassSpec,
742
            ClassSpec,
743
            ClassSpec,
744
            ClassSpec,
745
            ClassSpec,
746
            ClassSpec,
747
            ClassSpec,
748
            ClassSpec,
749
            ClassSpec,
750
            ClassSpec,
751
            ClassSpec,
752
            ClassSpec,
753
            ClassSpec,
754
            ClassSpec,
755
            ClassSpec,
756
            ClassSpec,
757
            ClassSpec,
758
            ClassSpec,
759
            ClassSpec,
760
            ClassSpec,
761
            ClassSpec,
762
            ClassSpec,
763
            ClassSpec,
764
            ClassSpec,
765
            ClassSpec,
766
            ClassSpec,
767
            ClassSpec,
768
            ClassSpec
769
        >::Result
770
    > instance;
771
    return instance;
772
}
773
 
774
int main ()
775
{
776
    return 0;
777
}

powered by: WebSVN 2.1.0

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