<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60797>60797</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[C++20] [Modules] Should we ignore the inconsistent `-fvisibility-hidden` options?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:modules
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ChuanqiXu9
</td>
</tr>
</table>
<pre>
Reproducer:
```
// a.cppm
export module a;
// b.cppm
export module b;
import a;
```
Compile them with:
```
clang++ -std=c++20 a.cppm --precompile -o a.pcm -fvisibility=hidden -fvisibility-inlines-hidden
clang++ -std=c++20 b.cppm --precompile -o b.pcm -fprebuilt-module-path=.
```
We will get:
```
error: default visibility for functions and variables [-fvisibility] differs in PCH file vs. current file
```
I meet the problem in practice. And I feel the problem would be pretty common for users. For example, libb.so depends on liba.so but they have different visibility requirements. So here is the problem. I've ignore the error in our downstream implementation. But I want to ask more opinions before I make it upstream.
CC @iains @dwblaikie @davidstone
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE2P4zYM_TXKhbDhyLE9OfgwSRA0hwJF99BeJYuO2ZElrT6SnX9fyM52J0U7WCBwQsZ85Hv8ECHQ1SD2rDmw5rQRKU7W98cpCfOV_kz7jbTqvf8dnbcqDehZ_cqqE6u-P9vq8VlNfmb8DKIcnJtXF35z1keYrUoaQbD68BS_Bsj_DZD_BNC8-D8g_Cv38jza2ZFGiBPOcKc4fV7woIW5Mn5g_ABFiIrVp2E1efWgAUXhPA4P3MKCKN0wQzHeKJAkTfGd1aeJlELz5C3IaDIYivW_n0go_zuhfCR0HmUiHYtVm8KJTO9UfiLHHwh30hquGD8XAr23ubmgcBRJR_jBA0brYUxmiGRNAGEU3IQnITUGYM3hSYnmBIrGEX0AMvDb8RcYM4tbKGFI3qOJi-OTki8wI8bcQHDeSo1zRnJeDJEGLOHVKLjAiKif3rnbpBXI7MAY32Gw82zNUnsK6EMJZ-sBv4nZaWT8CJqkLIMFhQ6NCmBNdonskmnJ_w6TuOGDT678gyYevybyOKOJoYQvFib0CBQ-1lTChfHuhkBXY_0yk7DonAnZ5EHZuwnRo5iBclkZTWSVSzikCBe4CxMhWhDhDeYMYR2ZpQsSx2xfYBZvCBQhuRWpfNqGI7BdRYJMyD_UXWpBb4SLIW6kQrQGYaP6Wu3rvdhgv227tqlr3r5spn7cYr3tVI2dxN1uVC-VapoX3nbtTije7DfU84rXFd-2VbfbVl2Jot23vEIxdNv9i-BsV-EsSJda3-bS-uuGQkjYt1W37zZaSNRhOT6cr6tRv67THRjn-SL5PkcWMl0D21WaQgw_sCJFvdyu4_cdygPImsOvD4zmBF-mZTLuT20gM1gTKMTcVtZWT3v72Ne2AuuWmWf1eZO87qcYXch7tFytK8UpyXKwM-PnXNLjq3De_oVDZPy8cA2Mnxe6fwcAAP__lSC3Fw">