<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [Windows] __uuidof in a template parameter issue with MSVC abi"
   href="https://bugs.llvm.org/show_bug.cgi?id=39881">39881</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Windows] __uuidof in a template parameter issue with MSVC abi
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>mike.winterberg@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Between r345380 and r346630 (likely, in r345692), in C++17 mode passing
__uuidof(X) to a template parameter started failing with the error "cannot yet
mangle expression type ConstantExpr" if the target is i386-pc-windows or
amd64-pc-windows.

Compiling this code:
typedef struct _GUID
{
    unsigned long  Data1;
    unsigned short Data2;
    unsigned short Data3;
    unsigned char  Data4[8];
} GUID;
struct __declspec(uuid("12345678-1234-1234-1234-123456789abc")) uuid;

template <const _GUID*>
struct baz {
};
baz<&__uuidof(uuid)> y;

as -std=c++17 -fms-extensions -target amd64-pc-windows results in this error:
uuidof.cc:12:5: error: cannot yet mangle expression type ConstantExpr

CE link just to show the effect of different flags:
<a href="https://gcc.godbolt.org/z/PXV4rO">https://gcc.godbolt.org/z/PXV4rO</a></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>