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

            Bug ID: 35055
           Summary: friend declaration in derived class does not get
                    honored
           Product: clang
           Version: 5.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: john.tyt...@esko.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

The following produces a ".... is a protected member of..." error while the
friend declaration in the derived class is honored by gcc (multiple versions
upto trunk), Visual Studio (multiple versions upto VS2017) and ICC.

Are they all wrongly accepting this code, or is this a Clang only issue ?

--8<--
class AFriend;

class Foo
{
        protected:
                static void Bar();
};

#if 1
class DerivedFoo
:       public Foo
{
        friend class AFriend;
};
#endif

class AFriend
{
        public:
                void CallFooBar()
                {
                        Foo::Bar();
                }
};
--8<--

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to