[llvm-bugs] [Bug 41768] New: OpenMP default(none) - std::cerr is not diagnosed as "not specified in enclosing 'parallel'", unlike GCC

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 6 07:03:21 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41768

            Bug ID: 41768
           Summary: OpenMP default(none) - std::cerr is not diagnosed as
                    "not specified in enclosing 'parallel'", unlike GCC
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

#include <iostream>
void test(int chunkSize) {
#pragma omp parallel default(none) 
    std::cerr << "hi";
}

clang accepts that code, gcc does not:
<source>: In function 'void test(int)':
<source>:4:18: error: 'cerr' not specified in enclosing 'parallel'
    4 |     std::cerr << "hi";
      |                  ^~~~
<source>:3:9: error: enclosing 'parallel'
    3 | #pragma omp parallel default(none)
      |         ^~~
Compiler returned: 1

https://godbolt.org/z/hC0cbC

-- 
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/20190506/98e36ea6/attachment.html>


More information about the llvm-bugs mailing list