title: Why using auto with reference to an array gets deduced to a pointer?
body: <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  
  int main(){
    int ar[] = {1,2,3};
    int (&amp;ref)[3] = ar;
  
    auto ar_ref1 = ref;
    int (&amp;ar_ref2)[3] = ref;
  
    printf(&quot;%d\n&quot;, sizeof(ar_ref1)); // 8
    printf(&quot;%d\n&quot;, sizeof(ar_ref2)); // 12
    return 0;
  }
  </code></pre>
  <p>I was expecting <code>ar_ref1</code> to be initialized the same as <code>ar_ref2 </code> but it's not. It became <code>int*</code>, why is that? The compiler can clearly see <code>ref</code> is a reference to an array with 3 ints.</p>