<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55318>55318</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Inline assembly and "error: dereference of pointer to incomplete type 'const char[]'"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
lhmouse
</td>
</tr>
</table>
<pre>
[This example](https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended-Asm) as suggested by GCC manual is rejected by clang (godbolt <https://gcc.godbolt.org/z/Gnc459jbG>):
```c
void
test(void* p, long count)
{
__asm__("repne scasb"
: "=c" (count), "+D" (p)
: "m" (*(const char (*)[]) p), "0" (-1), "a" (0));
}
```
```text
<source>:8:16: error: dereference of pointer to incomplete type 'const char[]'
: "m" (*(const char (*)[]) p), "0" (-1), "a" (0));
^
1 error generated.
Compiler returned: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFVE1v4yAQ_TX4gmrZEJr44EM-utXe9x5hmNiuMFiAu83--h1sp2mrHldayzjMG5h582DSOH2tiTj86vpA4U0OowEiToTtuhjHQPiesB_4tkrlrZ1y51u0nDW9Be1UWFz4fXqLYDXoh30Y8i4OhjD-ESOsojLQMLUthAiaNlf6fDzSQdpJGorZPbyAWj3KSNtSZNE63TgTKeHHbwgtzpXUHxzPVm1E9dI8E_6EGdPq4kSK2_exWF612K-u18ssIifMNgNsT0fCjtQ4pKDcZGOKNC-jlGwPtyml57MMw_mMGwljHkYLNCgZGrTui9KDPGgC-QmlYqmu97iYKHnY4bR6xg_ZPu0e1gVIcA5gQ6Sqk_4dq_Ac57Or6HgPXazbHso7JlesmCGU6XCv7_RFq28FjPAWV4gfg5u8gqQ43-9wlI-JMXjvfJpo8HDBYRVQd6Gj620ET6OjvVUuXbgINF5HQEbbe1m3Yrb_T4xPDxFPC14updEWLHiJFzZf8CPW0huszEOcPLZHolp-q2ama64rXsks9tFA_XPuJ-yPAENjrlRanZj9OwkZyyZv6i8t1MduanIMgIYxr7efh9G71Ipo9iFMkJpcCF7usq4WZVM9lo2USgEXoCUvWMM3SnDJm2IjMiMbMCH9pWBSC7_pHCJdcXHK-poVeAii2JaCi2KTwxYuRaE3kl8uO9AXsilgkL3JE4_U15mvZ0rN1AZ0mj7EcHeiYH1rAeql0kxOsXO4oxvcFCCbU9cz9b8xuWJ8">