通过 "this" 指针调用友元函数时 Eclipse 中的类型不匹配

Type-mismatch in Eclipse while calling friend function with a reference to an object via the "this" pointer

当我尝试通过取消引用 "this" 指针传递对所述 class 对象的引用来调用某个 class 的友元函数时,Eclipse 抛出一个类型不匹配错误,但程序仍然编译并且 运行s 就好了。

为了查看这是否是 Eclipse 独有的东西,我也尝试 运行使用一些在线编译器编译代码。 onlinegdb and codechef 已编译且 运行 未显示任何错误。由于该程序在技术上是可行的,所以我可以忽略此错误并继续前进,但由于我不想 运行 将来出现任何未定义的行为,最好现在就解决这个问题。

#include <iostream>

class Foo
{
public:
    Foo ()
    {
        Bar (*this); //<---The error occurs on this line
    }
friend void Bar (Foo &);
};

void Bar (Foo &foo)
{
    std::cout << "Inside Bar()!" << std::endl;
}

int main ()
{
    Foo foo;
}

错误信息:
无效参数 ' 候选人是: 无效酒吧(富&) '

将好友声明移到 class 声明的顶部解决了这个问题。显然,这是由于 Eclipse 的语法检查器无法正确检查代码而发生的。
感谢@Sam Varshavchik 和@john 的有用回复。