1 | namespace n { |
2 | struct D { |
3 | int i; |
4 | static int anInt() { return 2; } |
5 | int dump() { return i; } |
6 | }; |
7 | |
8 | class C { |
9 | public: |
10 | int foo(D *D); |
11 | }; |
12 | } |
13 | |
14 | using namespace n; |
15 | |
16 | int C::foo(D* D) { |
17 | return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) |
18 | //% self.expect("expression -- D::anInt()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) |
19 | |
20 | } |
21 | |
22 | int main (int argc, char const *argv[]) |
23 | { |
24 | D myD { .i: D::anInt() }; |
25 | C().foo(D: &myD); |
26 | return 0; |
27 | } |
28 | |