fix false positive: "function 'bar' could be declared as const" when class is declared as friend before

This is an example where the above suggestion is raised as a false positive:

class Foo {
    friend class Bar;
};

class Bar {
    double m;
    void bar() {
        m = 0;
    }
};