title: namespace in debug flags of in-class defined friend functions
body: <p>I'm dealing with a class that defines a friend function in the class without outside declaration</p>
  
  <pre><code>namespace our_namespace {
  template &lt;typename T&gt;
  struct our_container {
  
    friend our_container set_union(our_container const &amp;, our_container const &amp;) {
      // meaningless for the example here, just a valid definition
      // no valid semantics
      return our_container{};
    }
  };
  }  // namespace our_namespace
  </code></pre>
  
  <p>As discussed (e.g. <a href="https://stackoverflow.com/questions/7785886/">here</a> or <a href="https://stackoverflow.com/questions/3593032">here</a>) the function <code>set_union</code> is not in the <code>our_namespace</code> namespace but will be found by argument dependent lookup:</p>
  
  <pre><code>auto foo(std::vector&lt;our_namespace::our_container&lt;float&gt;&gt; in) {
    // works:
    return set_union(in[0], in[1]);
  }
  </code></pre>
  
  <p>I noticed however that <a href="https://godbolt.org/z/HbJemG" rel="nofollow noreferrer">in the debug flags</a> <code>set_union</code> appears to be in the <code>our_namespace</code> namespace</p>
  
  <pre><code>        mov     rdi, qword ptr [rbp - 40] # 8-byte Reload
          mov     rsi, rax
          call    our_namespace::set_union(our_namespace::our_container&lt;float&gt; const&amp;, our_namespace::our_container&lt;float&gt; const&amp;)
          add     rsp, 48
          pop     rbp
          ret
  our_namespace::set_union(our_namespace::our_container&lt;float&gt; const&amp;, our_namespace::our_container&lt;float&gt; const&amp;): # @our_namespace::set_union(our_namespace::our_container&lt;float&gt; const&amp;, our_namespace::our_container&lt;float&gt; const&amp;)
          push    rbp
          mov     rbp, rsp
          mov     qword ptr [rbp - 16], rdi
          mov     qword ptr [rbp - 24], rsi
          pop     rbp
          ret
  </code></pre>
  
  <p>although I can't call it as <code>our_namespace::set_union</code></p>
  
  <pre><code>auto foo(std::vector&lt;our_namespace::our_container&lt;float&gt;&gt; in) {
    // fails:
    return our_namespace::set_union(in[0], in[1]);
  }
  </code></pre>
  
  <p>Any hints about how the debug information is to be understood?</p>
  
  <p>EDIT: The <code>set_union</code> function body is only a strawdog example here to have a valid definition.</p>