title: Is there a compilation flag to detect duplicate lamda parameter-lambda member?
body: <p>This code compiles with g++, no collision is detected, although s is the parameter captured by lambda and the lambda parameter. My compiler is g++.</p>
  <p>gcc Version is</p>
  <pre><code>gcc (Debian 4.9.2-10+deb8u2) 4.9.2
  Copyright (C) 2014 Free Software Foundation, Inc.
  </code></pre>
  <p>and I am using these compilation flags :</p>
  <pre><code>-W 
  -Wall
  -ansi
  -pedantic
  -s 
  -march=native
  -flto 
  -fwhole-program 
  -Wfatal-errors 
  -Wextra 
  -std=c++1y 
  -frename-registers 
  -fipa-pta 
  -Ofast 
  -pedantic-errors 
  -fira-loop-pressure
  -fomit-frame-pointer
  -fforce-addr 
  -falign-functions 
  -fno-cprop-registers 
  -fstrength-reduce
  </code></pre>
  <p>Code is</p>
  <pre><code>#include &lt;vector&gt;
  #include &lt;algorithm&gt;
  #include &lt;iostream&gt;
  
  int main (int argc, char* argv []) {
    int s (0);
    std::vector&lt;int&gt; vec ({3, 5, 13, 1});
    std::for_each (vec.begin (), vec.end (), [&amp;s] (const int&amp; s) {
      s = s&gt;s?s:s;
    });
    std::cout &lt;&lt; &quot;max ox v is &quot; &lt;&lt; s &lt;&lt; std::endl;
  }
  </code></pre>
  <p>Is there a compilation option to detect this kind of error ?</p>