<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Dependencies on array elements don't work with templated index type"
   href="https://bugs.llvm.org/show_bug.cgi?id=45383">45383</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Dependencies on array elements don't work with templated index type
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>schuchart@hlrs.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I stumbled across a weird error Clang 9 gives me when trying to compile the
following code snippet:

```
template<typename IndexT>
void test(double *A, IndexT k)
{
  #pragma omp task depend(out: A[k])
  {
    // do something
  }
}

int driver(double *A) 
{
  int k = 0;
  test(A, k); 
  return 0;
}
```

The error:
```
$ clang++-9 test_omp_dep_template.cc -fopenmp -c
test_omp_dep_template.cc:4:34: error: expected addressable lvalue expression,
array element or array section
  #pragma omp task depend(out: A[k])
                               ~~^~
```

If I replace IndexT with int it compiles fine. I can then template the type of
A and Clang will compile fine. Compiling this with GCC works too (last time I
checked was 7.3.0).

Is this expected behavior?</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>