Type: LanguageService
No error emitted about inaccessible base class member in inline friend function of derived class.
Describe the bug
- OS and Version: Linux x64 5.4.2-arch1-1
- VS Code Version: 1.40.2
- C/C++ Extension Version: 0.26.2
To Reproduce
- Create and compile a
.cpp file which contains the following codes:
class Base {
protected:
int prot_mem;
};
class Sneaky : public Base {
inline friend void clobber(Sneaky &s) { s.j = s.prot_mem = 0; }
inline friend void clobber(Base &b) { b.prot_mem = 0; }
int j;
};
Expected behavior
Identify b.prot_mem as error just as if the error appears in a out-of-class friend function definition:
int Base::prot_mem
protected member "Base::prot_mem" (declared at line 3) is not accessible through a "Base" pointer or object
Screenshots

