title: Do nested classes obtain friendship relations of outer class?
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  class A {
      friend class B;
      std::string m = "Hello";
  };
  
  struct B {
      struct N {
          void f(){
              A a;
              std::cout &lt;&lt; a.m &lt;&lt; std::endl;
          };
      };
  };
  
  int main() {
      B::N().f();
  }
  </code></pre>
  
  <p>Is N allowed to access m? </p>
  
  <p><em>EDIT</em></p>
  
  <p>Okay I ran it in cpp.sh and obviously it works. Is there a generic rule to understand how friendship relations are obtained? </p>