<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66539>66539</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Error on accessing struct members after atomic load
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wrenger
</td>
</tr>
</table>
<pre>
The following code (compiled with clang version 16.0.6 (Fedora 16.0.6-3.fc38)) produces the error "cannot compile this l-value expression yet". GCC (13.2.1) does not complain and compiles this successfully.
I found other issues with this error message, but they did not seem to be related (from what I understand) and most focus on C++.
```sh
clang test.c -o test
gcc test.c -o test
```
```c
#include <stdatomic.h>
#include <stdio.h>
struct data {
int inner;
};
int main() {
_Atomic(struct data) data = (struct data){0};
printf("%d", atomic_load(&data).inner);
}
```
Full error message:
```
test.c:11:16: error: cannot compile this l-value expression yet
printf("%d", atomic_load(&data).inner);
^~~~~~~~~~~~~~~~~~
/usr/lib64/clang/16/include/stdatomic.h:133:29: note: expanded from macro 'atomic_load'
#define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE9vozgU_zTO5SkI7EDCgUOSllUPq9Vqeo-M_QCvjB3Zpp1e9rOvbMhMm2kPKw1Cxvj5_d7v_eXeq8EgNqQ8kfJhw-cwWte8OjQDuk1n5VvzPCL0Vmv7qswAwkoEQg_CTlelUcKrCiMIzc0AL-i8sgaKKsuzKt5qUVrH14Mty3rBDoTWhNZwdVbOAj2EEQGdsw4IpYIbYwOs6BBG5UFvX7ieEfD71aFPFt4wEEoz-ON8jmYKltGsiKjSoocbgubKADfyBucXPD8Lgd73s9ZvGckfSH5c1ifo7Wwk2DCiA-X9jH7xL-ktJCf0ng9I6Bm6OUT2byCVTEY94g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