brintos

brintos / llvm-project-archived public Read only

0
0
Text · 575 B · 6df5c92 Raw
28 lines · cpp
1namespace 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 14using namespace n;15 16int 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 22int main (int argc, char const *argv[])23{24    D myD { D::anInt() };25    C().foo(&myD);26    return 0; 27}28