title: error xxx in yyy does not name a type
body: <p>Compiling file <code>error_xxx_does_not_name_a_type.cpp</code>, why do I get error<br>
  <code>error_xxx_does_not_name_a_type.cpp:5:28: error: ‘A’ in ‘struct std::pair&lt;bool, int&gt;’ does not name a type std::pair&lt;bool, int&gt; ::A::B::C::D::get_i()</code>  </p>
  
  <pre><code>// error_xxx_does_not_name_a_type.h
  #pragma once
  #include &lt;utility&gt;
  
  namespace A{ namespace B{ namespace C{
  struct D
  {   
      std::pair&lt;bool, int&gt; get_i();
      std::pair&lt;bool, int&gt; get_j();
      std::pair&lt;bool, int&gt; get_k();
      int get_l();
  };  
  }}}
  </code></pre>
  
  <p>and  </p>
  
  <pre><code>// error_xxx_does_not_name_a_type.cpp
  #include "error_xxx_does_not_name_a_type.h"
  
  #if 1 // gives me the error
  std::pair&lt;bool, int&gt; ::A::B::C::D::get_i()
  { return {true, 10}; }
  #endif
  // But none of the below do
  // missing ::
  std::pair&lt;bool, int&gt; A::B::C::D::get_j()
  { return {true, 10}; }
  // trailing return type
  auto ::A::B::C::D::get_k()-&gt;
      std::pair&lt;bool, int&gt;
  { return {true, 10}; }
  // return type int
  int ::A::B::C::D::get_l()
  { return 10; }
  </code></pre>
  
  <p>I have compiled with <code>g++ -Wall -Wextra -std=c++14 -c error_xxx_does_not_name_a_type.cpp</code> and on <code>g++ (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204</code></p>