[clang] [clang] Define ATOMIC_FLAG_INIT correctly for C++. (PR #97534)

Chris Copeland via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 22:03:39 PDT 2024


chrisnc wrote:

Rebased and added a test case. I confirmed that the test fails using the current definition of `ATOMIC_FLAG_INIT`:

```
error: 'expected-error' diagnostics seen but not expected:
  Line 38: non-constant-expression cannot be narrowed from type 'int' to 'atomic_bool' (aka '_Atomic(bool)') in initializer list
error: 'expected-note' diagnostics seen but not expected:
  Line 38: insert an explicit cast to silence this issue
2 errors generated.
```

https://github.com/llvm/llvm-project/pull/97534


More information about the cfe-commits mailing list