<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54574>54574</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Modules] Can't disable warnings on instantiations of imported templates
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JohelEGP
</td>
</tr>
</table>
<pre>
See https://godbolt.org/z/PMMqn6rv7.
This `mod.cpp`, compiled with `-Wconversion`:
```C++
export module mod;
export char convert(auto i) { return i; }
```
And this `test.cpp`, compiled with `-Wno-implicit-int-conversion`:
```C++
import mod;
int main() {
_Pragma("GCC diagnostic ignored \"-Wimplicit-int-conversion\"")
return convert(0);
}
```
Results in the following warning:
```
In file included from /app/test.cpp:1:
mod.cpp:2:38: warning: implicit conversion loses integer precision: 'int' to 'char' [-Wimplicit-int-conversion]
export char convert(auto i) { return i; }
~~~~~~ ^
test.cpp:4:10: note: in instantiation of function template specialization 'convert<int>' requested here
return convert(0);
^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVNtunDAQ_RrzMtoVa5awPPCwt0StFClqK-UxMjAsrrw2sU22zdd3DHtJt0rUqsjYHg8en3M8Q2nqn8VXRGi97xxLlozfUtuZujTKT43dkfVK78P9_bO-sS_ZlMUbFi_H_lsrHbCbeG_qadV1NGN8DZXZd1JhDQfp2-CePFZGv6B10ujwTXLcHuZDWzO-Cm1YxR-dsR4oZq8wDCz53VO1wsIY0TO-EL03IBnPgWUrsOh7q8lOVmRvrg4azaWuwR-he3T-Y-zaTOS-U7KSfiK1n_wLF9p45HImQSFgL6Qm5EfM4_rTgxW7vRiW-d16DbUUO22clxVImlgCxVKKzieP7-EZ3EPLx6Bw0uMiVxycJzDvKfQFXa-8A6lJKITGKGUOUu_gIKym8U_ao_lJQ0Py0b5K9TUhbqzZA-WPIIX57VnsZDk7hzglT7Lk9CYL6t4cAyeucOEJyjgM4Dzu0EJnsZIDf_qc8YzWqQfKChpCsgSLpasPdNv8Z4LBhw_LtleN4GzHnW8kmQdZQkaBNh4H7nSOdl5oL4UPxE0DTa-rYe6R2AiP4DriL5R8Hb8JpI_Yk3XQItkGASw-93QW3UmLFv8uPS4MTnDP9x3VRVLnSS4iL73CgvS9HyrWkZqwFpTfmaccdqKkfDjepwNzxcgFSmOVELITJRf1VhVX_yQqyL6cUoGSodTLaZh01nzHirDfSueIIk3SeZrNo7bIm6aZx9ViEc_SvMyzqmxSjLO04bTczGaREiUqF8BT1Wg8wBAiVFC6iWTBY87jhN_wZMbj-TRrZtiUyTxv4rrGRcbmMVIpq2nAEX6WkS0GSGW_c-RU0nl3cQrnqJBx0CrEp7xqjS0-mxbV9u4hGs4uBuy_ANS8sWg">