title: Is the friend declaration a real declaration?
body: <p>C++ Primer says:</p>
  <blockquote>
  <p>It is important to understand that a friend declaration affects access but is not a declaration in an ordinary sense.</p>
  </blockquote>
  <p>So friend declaration should offer access authority only to the friend class/function, it is not a real declaration.</p>
  <p>However, I tried this program, it complied successfully and outputs <code>2</code> in GCC 5.2.0, what's wrong?</p>
  <pre><code>#include &lt;iostream&gt;
  
  class Tmp {
   public:
    Tmp(int a) : a_(a) {};
  
   private:
    int a_;
  
    friend void p(Tmp a) { std::cout &lt;&lt; a.a_ &lt;&lt; std::endl; }
  };
  
  // void p(Tmp a); I commented it, so there is not any declaration statement for p(Tmp a).
  
  int main(void) {
    Tmp a(2);
    p(a);
    return 0;
  }
  </code></pre>