https://bugs.llvm.org/show_bug.cgi?id=51327
Bug ID: 51327
Summary: Range based for loop not working if range's type is a
template.
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Clang Compiler Support
Assignee: unassignedclangb...@nondot.org
Reporter: northon_patri...@yahoo.ca
CC: llvm-bugs@lists.llvm.org
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs