<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Protected friend function in parent class will not compile"
   href="http://llvm.org/bugs/show_bug.cgi?id=19686">19686</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Protected friend function in parent class will not compile
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bugzilla@wunderbear.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Steps to Reproduce:
Compile the following code:

    class A {
    protected:
        void ProtectedMemberFunc() {}
    };

    class B : public A {
        friend void A::ProtectedMemberFunc();
    };

Expected result:
The code compiles without error.

Actual result:
The following error is raised:

main.cpp:8:20: error: friend function 'ProtectedMemberFunc' is a protected
member of 'A'
    friend void A::ProtectedMemberFunc();
                ~~~^
main.cpp:8:20: note: must name member using the type of the current context 'B'

Additional Notes:
Exact version: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Similar to bug <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Friend class cannot access protected field of parent"
   href="show_bug.cgi?id=6840">http://llvm.org/bugs/show_bug.cgi?id=6840</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>