Open
Description
As I suppose this check is expected to show warning in A::getThis
method:
struct A {
const A& getThis() const{ return *this; };
};
But it didn't. Logically I don't see any difference between A::getThis
method and getThis
regular function like this:
const A& getThis(const A& a) { return a; };
But the alalizer thinks that there is a difference! And show warning only for getThis
regular function.
The warning should also be provided for A::getThis
method because the known lifetime issue is also actual for it:
const auto& a = A().getThis();
// dangling `a`
The full snippet here: https://godbolt.org/z/xb669s6f3