title: Declaration after use
body: <p>The draft C++20 standard <a href="http://open-std.org/JTC1/SC22/WG21/docs/papers/2020/n4861.pdf" rel="nofollow noreferrer">N4861</a> sect. 6.5.1(7) reads:</p>
  <blockquote>
  <p>A name used in the definition of a class <code>X</code> outside of a
  complete-class context of <code>X</code> shall be declared ... before its use in
  class <code>X</code> or be a member of a base class of <code>X</code>....</p>
  </blockquote>
  <p>So why does the following compile?</p>
  <pre><code>#include &lt;iostream&gt;
    
  struct X {
      X(const int i_) : i(i_) {}
      int f() const { return 3*g(); }
      int g() const { return 2*i; }
      const int i;
  };
  
  int main()
  {
      const X x{7};
      std::cout &lt;&lt; x.f() &lt;&lt; &quot;\n&quot;;
  }
  </code></pre>
  <p>I mean, of course, it should indeed compile, and does, and the output is <code>42</code> just as one would expect; but I do not understand the standard's phrasing. The standard says, &quot;before its use,&quot; but in the example, isn't <code>g()</code> declared <em>after</em> its use? And <code>i</code>, too.</p>