title: GCC `-fsanitize=bounds` strange behaviour with `std::array`
body: <p>I'm trying find out of bounds problems in my code using <code>-fsanitize=bounds</code> option, but I faced with strange behaviour:</p>
  <p>For instance in the following code:</p>
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;array&gt;
  
  int main (int, char **)
  {
      std::array &lt;char, 1&gt; a;
      const char b = a [X]; // X &lt;--- put index here!
  
      return EXIT_SUCCESS;
  }
  </code></pre>
  <p>compiled with options: <code>$ g++ -std=c++11 -fsanitize=bounds -O0 main.cpp -o main</code>.</p>
  <p>If I try access to element with index more than 1, errors are reported:
  <code>/usr/include/c++/5/array:53:36: runtime error: index 2 out of bounds for type 'char [1]'</code> .</p>
  <p>But if I try access to element with index 1, everything OK and no errors are reported.</p>
  <p>Is it expected behaviour and may be I've missed something?</p>
  <p>The example is tested on:</p>
  <ul>
  <li><code>$ g++ --version g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609</code>;</li>
  <li><code>$ g++ --version g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005</code>.</li>
  </ul>
  <p><strong>UPDATE</strong><br />
  I tried <code>-fsanitize=bounds-strict</code> in GCC 6 and resulted the same.</p>