Wrongly report '_Atomic(int) *' as not trivially-copyable type

Answered

Hi, just have a look of my following code (gcc as compiler)

int main() {
_Atomic int a = 1;
_Atomic int b = 2;
__atomic_load (&a, &b, __ATOMIC_RELAXED);
int c = 3;
int d = 4;
__atomic_load (&c, &d, __ATOMIC_RELAXED);
}

Clion inspection gives me an error message that Address argument to atomic operation must be a pointer to a trivially-copyable type ('_Atomic(int) *' invalid) for the first __atomic_load call, I thought it may be a wrong report since the second call looks well in clion editor.

How can I get rid of this problem?

0
3 comments

Hello!

What CLion version do you use? Is clangd enabled for you project (Settings/Preferences | Languages & Frameworks | C/C++ | Clangd)?

0
Avatar
Permanently deleted user

The latest version of CLion,

CLion 2019.3.4
Build #CL-193.6494.38, built on February 11, 2020

with clangd enabled(all configuration is of the initial status)

0

Please sign in to leave a comment.