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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Origin: PR c++/42824
2
// { dg-do compile }
3
 
4
template
5
class int_ {
6
};
7
 
8
template
9
class Unit {
10
public:
11
    Unit(const Unit& other) {}
12
};
13
 
14
template
15
class Quan {
16
public:
17
    Quan(void) {}
18
 
19
    template
20
    Quan(double value, Unit unit) {}
21
};
22
typedef Quan<0> Scalar;
23
 
24
template
25
class hlp {
26
public:
27
   typedef Quan type;
28
};
29
 
30
class Mtrl {
31
public:
32
    template
33
    struct AssoType {
34
        typedef typename hlp::type type;
35
    };
36
};
37
 
38
template
39
class Eval {
40
public:
41
    Eval(const T& object){}
42
 
43
    template
44
    void eval() {
45
        eval (int_<0>());
46
    }
47
private:
48
    template struct Wrap {};
49
 
50
    template
51
    void value(Wrap >) {}
52
 
53
    template
54
    void value(Wrap) {}
55
 
56
    template
57
    void eval(int_<0>) {
58
        typedef typename T::template AssoType::type Type;
59
        value(Wrap());
60
    }
61
};
62
 
63
class Foo {
64
public:
65
    static void eval(const Mtrl& mtrl) {
66
        Eval h(mtrl);
67
        h.eval<0> ();
68
    }
69
};
70
 

powered by: WebSVN 2.1.0

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