title: Is std::vector<int, std::allocator<char> > valid?
body: <p>The standard says nothing about the allocator of <code>std::vector</code> but only requires the allocator to satisfy the <code>Allocator</code> concept. Nothing about the allocator's value_type, no reference_type, no nothing.</p>
  
  <p>I thought <code>std::vector&lt;T, A&gt;</code> internally rebinds <code>A</code> to an allocator for <code>T</code>, so I gave a vector <code>std::allocator&lt;char&gt;</code> and it worked as expected.</p>
  
  <p>However, GCC generates errors if <code>std::allocator&lt;void&gt;</code> is given, as below:</p>
  
  <pre><code>/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/ext/alloc_traits.h: In instantiation of ‘struct __gnu_cxx::__alloc_traits&lt;std::allocator&lt;void&gt; &gt;’:
  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/bits/stl_vector.h:75:28:   required from ‘struct std::_Vector_base&lt;int, std::allocator&lt;void&gt; &gt;’
  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/bits/stl_vector.h:214:11:   required from ‘class std::vector&lt;int, std::allocator&lt;void&gt; &gt;’
  a.cpp:5:42:   required from here
  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/ext/alloc_traits.h:109:53: error: forming reference to void
       typedef value_type&amp;                             reference;
                                                   ^
  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/ext/alloc_traits.h:110:53: error: forming reference to void
       typedef const value_type&amp;                       const_reference;
                                                   ^
  </code></pre>
  
  <p>Is it a GCC's bug? or am I misreading the standard?</p>
  
  <ul>
  <li>GCC version : 4.9.2</li>
  </ul>