[llvm-bugs] [Bug 28523] New: Unexpected compilation error with OpenMP: reference to local variable declared in enclosing function
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Tue Jul 12 09:41:19 PDT 2016
    
    
  
https://llvm.org/bugs/show_bug.cgi?id=28523
            Bug ID: 28523
           Summary: Unexpected compilation error with OpenMP: reference to
                    local variable declared in enclosing function
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tiago at skewed.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified
Created attachment 16730
  --> https://llvm.org/bugs/attachment.cgi?id=16730&action=edit
Test program that causes the error.
The attached test fails with:
$ clang++ --std=gnu++14 -fopenmp clang_test.cc -o clang_test
clang_test.cc:20:23: error: reference to local variable 'x' declared in
enclosing function 'main'
                      x = y;
                      ^
clang_test.cc:9:9: note: in instantiation of function template specialization
'main()::(anonymous class)::operator()<int>' requested here
        f(v[i]);
        ^
clang_test.cc:16:5: note: in instantiation of function template specialization
'parallel_loop<std::vector<int, std::allocator<int> >, (lambda at
clang_test.cc:17:19)>' requested here
    parallel_loop(v,
    ^
clang_test.cc:15:12: note: 'x' declared here
    double x;
           ^
1 error generated.
GCC compiles this fine, and I don't see why clang shouldn't as well.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160712/99127239/attachment-0001.html>
    
    
More information about the llvm-bugs
mailing list