[LLVMbugs] [Bug 16449] Template functions see friendship as inherited

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 25 12:01:22 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16449

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Templates seem to be a red herring here. Clang accepts this too:


class Base {
private:             
  friend void foo(); 
  void bar();  
};

class Derived : public Base {};

void foo() { Derived().bar(); }


And indeed this all appears to be correct. Per [class.access.spec]p5, the
member 'bar' is accessible within 'foo' when named in class 'Derived', because
there exists a base class 'Base' of 'Derived' that is accessible within 'foo',
and 'bar' is accessible within 'foo' when named in class 'Base'.

-- 
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/20130625/4a3c287e/attachment.html>


More information about the llvm-bugs mailing list