<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 --- - Templates in Microsoft Mode do not allow casting from one type to another"
   href="http://llvm.org/bugs/show_bug.cgi?id=16851">16851</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Templates in Microsoft Mode do not allow casting from one type to another
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david.majnemer@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We should allow the following but we do not:
template <const void *>
struct foo {
};

extern const int x;
foo<(const void *)&x> a;
foo<&x> b;
foo<((const void *)&x)> c;

instead, we claim:
<stdin>:6:5: error: non-type template argument does not refer to any
declaration
foo<(const void *)&x> a;
    ^~~~~~~~~~~~~~~~
<stdin>:1:23: note: template parameter is declared here
template <const void *>
                      ^
<stdin>:7:6: error: non-type template argument of type 'const int *' cannot be
converted to a value of type 'const void *'
foo<&x> b;
     ^
<stdin>:1:23: note: template parameter is declared here
template <const void *>
                      ^
<stdin>:8:5: warning: address non-type template argument cannot be surrounded
by parentheses
foo<((const void *)&x)> c;
    ^~~~~~~~~~~~~~~~~~
<stdin>:8:6: error: non-type template argument does not refer to any
declaration
foo<((const void *)&x)> c;
     ^~~~~~~~~~~~~~~~
<stdin>:1:23: note: template parameter is declared here
template <const void *>
                      ^
1 warning and 3 errors generated</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>