<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 - Clang compiler failed with error for the test with sum of variables declared with "constexpr __attribute__((vector_size()))""
href="https://bugs.llvm.org/show_bug.cgi?id=37739">37739</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang compiler failed with error for the test with sum of variables declared with "constexpr __attribute__((vector_size()))"
</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>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>soumi.manna@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>-bash-4.2$ clang -c -std=c++11 test.cpp
test.cpp:3:21: error: constexpr variable 's' must be initialized by a constant
expression
constexpr vec s = v + v;
~~^~~
1 error generated.
-bash-4.2$ cat test.cpp
typedef long vec __attribute__((vector_size (2 * sizeof (long))));
constexpr vec v = { 3, 4 };
constexpr vec s = v + v;
Clang doesn't consider sum of two variables of type "constexpr long
__attribute__((vector_size (2 * sizeof (long))))" as constant expression.
If I change "constexpr vec s" to just "vec s" this test will pass.
GCC compiles the test without any error.</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>