qqiangwu / cppsafe

Cpp lifetime safety profile static analyzer
MIT License
48 stars 1 forks source link

pointer of containers #35

Closed qqiangwu closed 7 months ago

qqiangwu commented 7 months ago
struct Test
{
    Owner<int*> o;

    void test()
    {
        auto* p = o.get();
        __lifetime_pset(p);  // expected-warning {{pset(p) = (**this)}}

        auto& q = o.get();
        __lifetime_pset(q);  // expected-warning {{pset(q) = (*this)}}
    }
};