<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - decltype of parenthesized xvalue does not correctly yield rvalue-reference"
   href="https://llvm.org/bugs/show_bug.cgi?id=25055">25055</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>decltype of parenthesized xvalue does not correctly yield rvalue-reference
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>treh@think-cell.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code snippet contains the parenthesized decltype of an xvalue:

#include <type_traits>

struct Member {};
struct A { Member x; };
A MakeA();

static_assert(std::is_same<decltype((MakeA().x)), Member&&>::value, ""); //
MSVC++ 2015
//static_assert(std::is_same<decltype((MakeA().x)), Member>::value, ""); //
clang, gcc

The standard says in ยง7.1.6.2 about decltype(e)
(4.1) [...] unparenthesized case, does not apply here
(4.2) if e is an xvalue, decltype(e) is T&&, where T is the type of e;

This means clang and gcc are not standard-conformant.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>