title: Why does this rvalue reference bind to an lvalue?
body: <p>I do not understand why the following code compiles on GCC 8.0:</p>
  
  <pre><code>decltype(auto) foo(int&amp;&amp; r) {
      return r;
  }
  </code></pre>
  
  <p>In <code>foo</code>, the declaration type of <code>r</code> is <code>int&amp;&amp;</code>, and so the return type of <code>foo</code> is also <code>int&amp;&amp;</code>. But <code>r</code> itself is an lvalue, and an lvalue  cannot bind to an rvalue reference.</p>
  
  <p>Am I missing something?</p>