https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90366

            Bug ID: 90366
           Summary: OpenMP default(none) - std::cerr is diagnosed as "not
                    specified in enclosing 'parallel'", unlike clang
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lebedev.ri at gmail dot com
  Target Milestone: ---

#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

This diagnostic is correct?

Reply via email to