<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:a.bataev@hotmail.com" title="Alexey Bataev <a.bataev@hotmail.com>"> <span class="fn">Alexey Bataev</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - segfault in __kmpc_for_static_init_4 running c++ example containing omp distribute private"
   href="https://bugs.llvm.org/show_bug.cgi?id=31988">bug 31988</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>a.bataev@hotmail.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - segfault in __kmpc_for_static_init_4 running c++ example containing omp distribute private"
   href="https://bugs.llvm.org/show_bug.cgi?id=31988#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - segfault in __kmpc_for_static_init_4 running c++ example containing omp distribute private"
   href="https://bugs.llvm.org/show_bug.cgi?id=31988">bug 31988</a>
              from <span class="vcard"><a class="email" href="mailto:a.bataev@hotmail.com" title="Alexey Bataev <a.bataev@hotmail.com>"> <span class="fn">Alexey Bataev</span></a>
</span></b>
        <pre>Your program does not meet the requirements of the OpenMP standard. Each
distribute construct must be strictly nested inside a teams region. The
following program works:
int main() {
        constexpr int x_outer = 1;
        int x = x_outer;
        #pragma omp target teams
        #pragma omp distribute private(x)
        for (int i = 0; i < 1; ++i)
                ;
}

Also, the next one works:
int foo() {
  constexpr int x_outer = 1;
  int x = x_outer;
#pragma omp distribute private(x)
  for (int i = 0; i < 1; ++i)
    ;
  return 0;
}

int main() {
#pragma omp target teams
  foo();
  return 0;
}</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>