<html>
    <head>
      <base href="http://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 --- - Member access expression not allowed on constexpr variable template in template context"
   href="http://llvm.org/bugs/show_bug.cgi?id=20451">20451</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Member access expression not allowed on constexpr variable template in template context
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </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++1y
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david_work@me.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The type of a constexpr variable template-id initialized with type deduction is
not resolved, but left as auto, when resolving a member access subexpression.

All these conditions must be satisfied, but it's still a common case to
encounter. The problem does not occur with implicit accesses to operator
overload members or the like, and the type will be resolved if the variable
template is passed through an identity function.


template< typename >
struct lit {
        constexpr operator int () const { return 0; }
};

template< typename t >
constexpr auto ft() { return lit< t >(); }

template< typename t >
constexpr auto vt = ft< t >();

template constexpr lit< void > vt< void >; // Work around 19571

template< typename t >
constexpr lit< t > const & ftr() { return vt< t >; }

template< typename t >
constexpr int ftv() { return vt< t >.operator int (); } // Failure

template< typename t >
constexpr int ftic() { return vt< t >; } // No failure

static_assert ( ftr< void >().operator int () == 0, "1" ); // OK
static_assert ( ftic< void >() == 0, "2" ); // OK
static_assert ( ftv< void >() == 0, "3" );

template< typename t >
constexpr t && id( t && o ) { return static_cast< t && >( o ); }

template< typename t >
constexpr int ftvid() { return id( vt< t > ).operator int (); } // OK

static_assert ( ftvid< void >() == 0, "3a" );</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>