<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124869>124869</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`__inline` causes header to fail to parse, when it succeeds in MSVC
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wmmc88
</td>
</tr>
</table>
<pre>
I was trying to parse a Windows header (`ufxclient.h`) using clang with the msvc compatibility flags (`-fms-compatibility -fms-extensions`) and ended up with the following error:
```
error: 'inline' can only appear on functions
```
I managed to narrow the issue down to several typdef definitions in the header that erroneously add `FORCEINLINE` to a function ptr typedef. This is one of them:
```
typedef
_IRQL_requires_max_(DISPATCH_LEVEL)
WDFQUEUE
FORCEINLINE
UFX_ENDPOINT_GET_COMMAND_QUEUE (
_In_ PUFX_GLOBALS,
_In_ UFXENDPOINT
);
typedef UFX_ENDPOINT_GET_COMMAND_QUEUE *PFN_UFX_ENDPOINT_GET_COMMAND_QUEUE;
```
MSVC successfully compiles this definition, but clang fails with the above error, even with all the ms compatibility flags/extensions enabled. I think clang should loosen this error to a warning so that the code still compiles. Or should allow this completely when the ms-compat options are enabled.
Minimal repros :
Passing in MSVC: https://godbolt.org/z/59MYbebax
Hard Error in Clang: https://godbolt.org/z/W8cs54oo6
Warning in Gcc, but still succeeds to compile: https://godbolt.org/z/Tbv7PsbKr
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVGGP4jYQ_TXmy2iRMRDgQz7kWHKHyrLc3e7t9VPkxBPi1rFT24Glv75ykoW9tmpPQkLKjN978_w83Dl51IgxmX8g8_sRb31lbHyu62K5HOVGXOItnLkDby9SH8EbaLh1CBxepBbm7KBCLtACYUsS0bZ8LZRE7ccViShhK2hdOFcoro9wlr4CXyHU7lRAYeqGe5lLJf0FSsWPbkC5K2t392O5-4SvHrWTRrsBnGsBqAUKaJsbemmUMudA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