<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 - __uuidof not constexpr"
href="https://bugs.llvm.org/show_bug.cgi?id=38490">38490</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__uuidof not constexpr
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</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>charles.milette@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When compiling the following code:
#include <dxgi1_2.h>
static constexpr auto test = __uuidof(IDXGIDevice1);
With clang, a compiler error is generated because __uuidof is not considered
constexpr:
dxgi.cpp:3:23: error: constexpr variable 'test' must be initialized by a
constant expression
static constexpr auto test = __uuidof(IDXGIDevice1);
^ ~~~~~~~~~~~~~~~~~~~~~~
dxgi.cpp:3:30: note: subexpression not valid in a constant expression
static constexpr auto test = __uuidof(IDXGIDevice1);
^
dxgi.cpp:3:30: note: in call to '_GUID(__uuidof(IDXGIDevice1))'
1 error generated.
Meanwhile with MSVC, __uuidof is indeed considered constexpr, so the code
builds fine.</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>