title: gcc acknowledging -Wfatal-errors parameter but not acting upon it
body: <p>Using the parameter, after every error gcc prints out "compilation terminated due to -Wfatal-errors."</p>
  
  <p>But it keeps going. Does not actually stop.</p>
  
  <p>I use:</p>
  
  <pre><code>g++ (x86_64-win32-seh-rev1, Built by MinGW-W64 project) 4.9.2
  </code></pre>
  
  <p>Calling the compiler:</p>
  
  <pre><code>@echo off
  set LIBRARY_PATH=D:\Projekte\C++\Arsenal of Democracy\sdk\Lib;C:\Program Files (x86)\Microsoft DirectX SDK (August 2008)\Lib\x86
  set CPLUS_INCLUDE_PATH=D:\Projekte\C++\Arsenal of Democracy\sdk\Include;C:\Program Files (x86)\Microsoft DirectX SDK (August 2008)\Include
  
  cd src
  g++ -m32 -mwindows -w -Wfatal-errors -std=c++14 -o ../AODGame.exe *.cpp
  cd ..
  </code></pre>
  
  <p>Compilation time is about the same as without the parameter. Number of errors is also the same.</p>
  
  <p><strong>However</strong>, if I construct a minimal example:</p>
  
  <pre><code>int main()
  {
    cout &lt;&lt; "Bla." &lt;&lt; endl; // 1st error - should abort here
    t - q = v;              // 2nd error - should not reach nor report
  }
  </code></pre>
  
  <p>and compile <strong>that</strong> with</p>
  
  <pre><code>g++ -Wfatal-errors -o Test Test.cpp
  </code></pre>
  
  <p>Then it <strong>does</strong> work and the second error never shows up (and it does without the parameter).</p>
  
  <p>What might be the cause of this irregularity? How can I circumvent it?</p>
  
  <p>Obviously I do not care whether compilation of a tiny example is aborted or not, but with a real project the time saved is - or rather would be - actually valuable.</p>
  
  <p>I have searched for this problem and only found ~two years old topics about different problems with the same parameter (not working on Clang, not included in gcc 3.x, etc.), none of which seems to be applicable here.</p>
  
  <p>--</p>
  
  <p>To follow @David Macek's comment, a minimal example with the same type of first error is</p>
  
  <pre><code>#include &lt;vector&gt;
  
  using namespace std;
  
  template&lt;class X&gt; void test(vector&lt;X&gt; &amp; v)
  {
    vector&lt;X&gt;::iterator i = v.begin();
  }
  
  int main()
  {
    t - v = q;
  }
  </code></pre>
  
  <p>It, too, correctly terminates after the very first error and never reaches the expression in main.</p>