<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108732>108732</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Behaviour of implicit inline member functions and extern "C++" in a module
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kamrann
</td>
</tr>
</table>
<pre>
It looks to me as if Clang is not doing the correct thing in the following case:
```
export module mod;
extern "C++" {
class C
{
public:
bool foo() const
{
return true;
}
};
}
```
>From what I can see, Clang is suppressing implicit `inline` for `foo`, but the [standard states](https://eel.is/c++draft/class.mfct#1) that implicit `inline` should apply to anything attached to the global module, which includes anything inside a module TU that is enclosed in `extern "C++"`. I checked also with cppinsights.com, which actually suggests Clang is applying the rule correctly, but my experience is otherwise so I'm guessing that either cppinsights is just wrong, or the issue is with the information not being forwarded correctly to the codegen phase.
The result is heaps of multiple definition linker errors when trying to combine include and import usage.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVNGO4jwPfZr0xlpUUijlohfLIKS53_8B0sRts5PGVZwMy9v_Sikw82lQRRsnto-Pj6OY7eARW7E_if25UCmOFNoPNQXlfdGRubXvERzRB0MkmBAUg-3hzSk_gGXwFMGQ9QPEEUFTCKgjxDFbrF-MPTlH12zQilFUv0V5FuVvUZfrsyzx30whwkQmOcwvUZ3Wg-t-xOBBSPkm5Gl5JIjDtzMA2ilmeHssn_sAc-qc1c_sAAAdkYOeSMhGyCNo8hxfu1988y9gTMFDDAmfyO7Hzusif33H_Nz7T633_0ugCa6jivAOWnlgRCHfXtRymueAzAuV0-ysthFEXVrvrEdRl9BTyIZcQl1m3y7FhXKxP3FU3qhggKOKyGJ_FrIZY5w5cyAvQl4Q3caykBd9Z9QE1ce8zCRupl5HIattpiZmlD9j4JGSM6Dm2d2yRJS_3buvYlR6RJONGdPgqFNubXAGex2tHsF67ZJB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