Type: LanguageService
Describe the bug
In-class friend function definition not identified by linter/parser.
To Reproduce
Open test.cpp which contains the following code:
#include <iostream>
struct A {
friend void fri(A) { std::cout << "fri()" << std::endl; }
void mem() {
std::cout << "mem(A)" << std::endl;
fri(*this);
}
};
int main() {
A a;
fri(a);
a.mem();
}
Expected behavior
Don't report problems as g++ doesn't complain during compilation.
$ g++ -std=c++17 vscode_debug.cpp -o a.out && ./a.out
fri()
mem(A)
fri()
Screenshots


Hi @escape0707 . Thanks for reporting this. The C/C++ Extension shares common code with Visual Studio for IntelliSense. I was able to reproduce something similar in Visual Studio, and have opened the following:
https://developercommunity.visualstudio.com/content/problem/819122/incorrect-squiggle-on-use-of-in-class-friend-funct.html
@escape0707 I recommend (using your|creating a) Microsoft Account to upvote the developer community issue. Issues with zero upvotes tend to stay unresolved for _quite_ some time.
@escape0707 I recommend (using your|creating a) Microsoft Account to upvote the developer community issue. Issues with zero upvotes tend to stay unresolved for _quite_ some time.
Okay, upvoted. Thanks for reminding me!
Most helpful comment
Hi @escape0707 . Thanks for reporting this. The C/C++ Extension shares common code with Visual Studio for IntelliSense. I was able to reproduce something similar in Visual Studio, and have opened the following:
https://developercommunity.visualstudio.com/content/problem/819122/incorrect-squiggle-on-use-of-in-class-friend-funct.html