[llvm-bugs] [Bug 46036] Clang prohibits base class friend member access

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 28 10:18:33 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46036

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Clang is correct; the friend declaration only lets you access protected members
of base classes when they're named as members of the befriending class. Within
ignored_friend_declaration_t it is valid to refer to test_child::value, but not
to test_base::value.

The C++ rules used to allow this kind of access, but were changed because it's
not implementable in general. See
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1873. I would
imagine the other implementations have not yet implemented the revised rule.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200528/6b0f0a04/attachment.html>


More information about the llvm-bugs mailing list