title: clang and gcc disagree on the type of conditional expression with xvalues
body: <p>I made a little test with the conditional operator to see the computed type of two object with same underlying type (same type when removing references and cv-qualifiers). GCC and clang++ agree in every combination (I have not test <code>volatiles</code>), except with xvalues:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;typeinfo&gt;
  
  struct A {};
  
  template&lt;class A&gt;
  void print_qualif()
  {
      using rm_r = std::remove_reference_t&lt;A&gt;;
  
      if (std::is_const&lt;rm_r&gt;::value)
          std::cout &lt;&lt; "const";
  
      if (std::is_lvalue_reference&lt;A&gt;::value)
          std::cout &lt;&lt; '&amp;';
      else if (std::is_rvalue_reference&lt;A&gt;::value)
          std::cout &lt;&lt; "&amp;&amp;";
      std::cout &lt;&lt; "  ";
  }
  
  #define res(X, Y) print_qualif&lt;decltype(true ? X : Y)&gt;()
  
  A&amp;&amp; x();
  A const&amp;&amp; xc();
  
  int&amp;&amp; ix();
  int const&amp;&amp; ixc();
  
  int main()
  {
      res(x(), xc()); // GCC prints const&amp;&amp; and clang const
      res(ix(), ixc()); // Both prints const&amp;&amp;
  }
  </code></pre>
  
  <p>Who is right? I will say GCC is right here because, when both operands have same value category and same underlying type, they keep the result keep the value category with the cv-qualifiers of the most qualified.</p>