Open Quuxplusone opened 4 years ago
Bugzilla Link | PR44708 |
Status | NEW |
Importance | P enhancement |
Reported by | Grzegorz Jablonski (grzejabl@gmail.com) |
Reported on | 2020-01-29 08:50:32 -0800 |
Last modified on | 2020-01-30 19:27:33 -0800 |
Version | 9.0 |
Hardware | PC Linux |
CC | blitzrakete@gmail.com, dblaikie@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Well, per [class.access.base]p5, "A member m is accessible at the point R when named in class N if [...] m as a member of N is private, and R occurs in a [...] friend of class N"
The reference to p->m occurs in class B, which is a friend of class A, so arguably this is valid.
This question is the subject of CWG issue 1699 (http://wg21.link/cwg1699), and the consensus opinion when that was last discussed seemed to be that Clang's current behavior is correct.