<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 - Range based for loop not working if range's type is a template."
href="https://bugs.llvm.org/show_bug.cgi?id=51327">51327</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Range based for loop not working if range's type is a template.
</td>
</tr>
<tr>
<th>Product</th>
<td>OpenMP
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Clang Compiler Support
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>northon_patrick3@yahoo.ca
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Example:
void do_loop(const auto &v)
{
#pragma omp parallel for
for(const auto &i : v){
std::cout << i << '\n';
}
}
Result in error:
error: initialization clause of OpenMP for loop is not in canonical form ('var
= init' or 'T var = init')
for(const auto &i : v){
^
Change `const auto &v` to say, `const std::vector<int> &v` and it work. I don't
know what the standard say about this case but it work under gcc and it would
also be very useful.</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>