[clang] [C] Add (new) -Wimplicit-void-ptr-cast to -Wc++-compat (PR #136855)

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 16 17:57:23 PDT 2025


ziqingluo-90 wrote:

Hi @AaronBallman I noticed that this commit makes a difference on the example below.
```
#include <stdatomic.h>
typedef const struct T * T_Ref;
static T_Ref _Atomic x = ATOMIC_VAR_INIT((void*)NULL);
```

After this commit, the AST of the global variable declaration changes---a level of `-ImplicitCastExpr '_Atomic(CFStringRef)' <NonAtomicToAtomic>` is removed,   resulting in a new `error: initializer element is not a compile-time constant`. (https://godbolt.org/z/aK8E9o47E)


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


More information about the cfe-commits mailing list