<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60782>60782</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[OpenMP] Metadirective with template parameter not compiling
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TApplencourt
</td>
</tr>
</table>
<pre>
Meta-directive + template parameter doesn't compile.
```
$ cat meta.cpp
template <bool use_omp>
int foo() {
int N = 10;
#pragma omp metadirective \
when(user={condition(use_omp)}: parallel for)
for (int i=0; i < N; i++) {}
}
int main() {
foo<true>();
}
$ clang++ -fopenmp meta.cpp
meta.cpp:5:61: error: expected expression
when(user={condition(use_omp)}: parallel for)
^
1 error generated.
```
Using a constant expression (`constexpr use_omp=true`) to replace the template parameter is working.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU02T4ygM_TXyhYoLgz_igw9Je3Pr3j3snrewrTjMYKAAd2b-_RTY3empynFSFBESSO89S8J7OWvEDqozVH0m1nAzrvv3ZK1CPZrVhWww08_uFYM4TNLhGOQ7EmBnEnCxSgQkVjixYEBHJoNeA2sCGc1ipcIcaA_0tO813dd2ZCUZRSALBpGP1m7ez6zAXwZjFFk9_m8WC_yv7YLUgVyNAXYE1hJozpubxF-MvRHgPSko8K8RYNw6MS-CmMWmkl_IVC_7zfsNNbDj6tEB76E5j0ZPMkizexMQ1kLTAz8l3kqhIlfjovdR7WocAXaMcCTwPmIhMjIib8kEdk5rw9_0uyAfRny3CKmfcYzU-UtwK0ZF0oVPpo9MUVol9LwVIoersah34g-tP0_8VAE_1UVkhc4Zl4wfFseAUzQceh9V-HMyQbV_z2KrSGbU6ETAKX_eLWn_z0s9E0FGo30QOnzBFgWHmqZI9D4ap09q1TRqGQxxaJUYkYQbPuth6cnduO9Sz3k2dXxqeSsy7Iq6qcvjseRldusGOrRNIQYs-ESnGtsrb5oWOSuxGNupzWTHKOOUFVXRFrwqc0ZpWQnGq3EYKBYIJcVFSJUr9b7kxs2Z9H7FrqbNkWVKDKh8GkrGNN5JCgJjcUZdF98chnX2UFIlffCPLEEGlab5b4v69R-oevL6W7PfZbg9o63Nx9BKPWerU90tBOuBn4BdgF1mGW7rkI9mAXaJ5fa_g3XmG44B2CWB9MAuicSvAAAA__8ps1IB">