title: No compiler diagnostic when identifier in a simple-capture appears as the declarator-id of a parameter
body: <p>The section on lambda captures <a href="http://eel.is/c++draft/expr.prim.lambda#capture-5" rel="nofollow noreferrer">([expr.prim.lambda.capture]/5</a>) states that </p>
  
  <blockquote>
    <p>If an identifier in a simple-capture appears as the declarator-id of a parameter of the lambda-declarator's parameter-declaration-clause, the program is ill-formed.</p>
  </blockquote>
  
  <p>Consider the follow example:  </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main ()
  {
      auto foo = 1234;
      auto bar = [foo](int foo) { std::cout &lt;&lt; foo &lt;&lt; '\n'; };
      bar(4321);     
  }
  </code></pre>
  
  <p>The latest GCC version (8.2.0 - released on July 26, 2018) has no diagnostic for this. Neither does latest Clang version (7.0.0 - released on Sep 19, 2018).</p>
  
  <p>Should there be a diagnostic (error/warning) from these compilers (as mentioned
  in the reference) along the lines of:  </p>
  
  <pre><code>// parameter and simple-capture have the same name
  </code></pre>
  
  <p>Godbolt Demo <a href="https://godbolt.org/z/2V-882" rel="nofollow noreferrer">here</a></p>