<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 - Supposedly-incorrect error 'constexpr variable... must be initialized by a constant expression'"
href="https://bugs.llvm.org/show_bug.cgi?id=36333">36333</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Supposedly-incorrect error 'constexpr variable... must be initialized by a constant expression'
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</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>enhancement
</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>sergey.ignatchenko@ithare.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=19850" name="attach_19850" title="preprocessed source">attachment 19850</a> <a href="attachment.cgi?id=19850&action=edit" title="preprocessed source">[details]</a></span>
preprocessed source
Preprocessed code attached compiles ok with GCC 7, MSVC, Apple Clang 9.0.0, and
current top-of-the-trunk Clang (after <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Reproducible Clang crash + strongly suspected invalid code generation"
href="show_bug.cgi?id=36055">bug #36055</a> has been fixed). However, with
Clang 5.0.0 and Clang 5.0.1 it issues
In file included from ../official.cpp:34:
../../src/obf.h:455:25: error: constexpr variable 'split' must be initialized
by
a constant expression
ObfDescriptor(true,0,sz4>1?100:0),
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
This doesn't make much sense - as (a) it is indeed about sz4 (replacing it
removes the bug here), and (b) as sz4 has been declared as constexpr just 7
lines above. Also - see above re. the same code being compiled ok with all the
other c++17 compilers (which doesn't qualify as a strict proof, but is a reason
to take a look ;-) ).
NB: it MIGHT be a different manifestation of recently-fixed <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Reproducible Clang crash + strongly suspected invalid code generation"
href="show_bug.cgi?id=36055">bug #36055</a>, but if
so - it would be nice to re-apply the fix back to Clang 5.0.x (which is still
the-latest-greatest-officially-released-Clang).
Command line:
clang-5.0 -DITHARE_OBF_INIT -DITHARE_OBF_CONSISTENT_XPLATFORM_IMPLICIT_SEEDS
-DITHARE_OBF_ENABLE_AUTO_DBGPRINT -DITHARE_OBF_SEED=0x4b295ebab3333abc
-DITHARE_OBF_SEED2=0x36e007a38ae8e0ea -o obftemp -std=c++1z -lstdc++ -Werror
../official.cpp</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>