struct B
{
template<typename Self>
auto bar(this Self &&)
{
return 0;
}
auto bar2(this B &&)
{
return 0;
}
};
struct A
{
auto foo()
{
return B{};
}
};
auto baz(int n)
{
return n;
}
int main()
{
A a{};
baz(a.foo().bar());
A a2{};
int n = a2.foo().bar2();
}
incorrect navigation of a.foo and a to baz, a2.foo and a2 to n
```c++
struct B
{
template<typename Self>
auto bar(this Self &&)
{
return 0;
}
auto bar2(this B &&)
{
return 0;
}
};
struct A
{
auto foo()
{
return B{};
}
};
auto baz(int n)
{
return n;
}
int main()
{
A a{};
baz(a.foo().bar());
A a2{};
int n = a2.foo().bar2();
}
```
incorrect navigation of a.foo and a to baz, a2.foo and a2 to n
incorrect navigation of a.foo and a to baz, a2.foo and a2 to n