title: How to force g++ to compile c++11 standard only?
body: <p><code>std::vector&lt;bool&gt;::emplace_back</code> is <a href="https://en.cppreference.com/w/cpp/container/vector/emplace_back#Notes" rel="noreferrer">available</a> only since C++14. However, with my g++ 5.4.0 it compiles ok even if I specify <code>-std=c++11</code>.</p>
  
  <p>When I compile the same code with g++ 4.8.4, it fails. Is there a way how to convince g++ to strictly check the selected standard?</p>
  
  <p>Note: I already use <code>-pedantic -Wextra -Wall</code>.</p>
  
  <p>Example <code>test.cpp</code>:</p>
  
  <pre><code>#include &lt;vector&gt;
  
  int main()
  {
      std::vector&lt;bool&gt; v;
      v.emplace_back(true);
      return 0;
  }
  </code></pre>
  
  <p>Compile with <code>g++ -std=c++11 test.cpp -o test</code>. With g++ 5.4.0 compiles ok, g++ 4.8.4 fires:</p>
  
  <pre><code>test.cpp: In function ‘int main()’:
  test.cpp:6:7: error: ‘class std::vector&lt;bool&gt;’ has no member named ‘emplace_back’
      v.emplace_back(true);
        ^
  </code></pre>