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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 19 07:47:41 PDT 2025


AaronBallman wrote:

> I think the conversion is dropped in `Sema::CheckAssignmentConstraints`. It isn't assigning `CK_NonAtomicToAtomic` to `Kind` because `result` is `AssignConvertType::CompatibleVoidPtrToNonVoidPtr`, not `AssignConvertType::Compatible`.
> 
> ```
>   // If we have an atomic type, try a non-atomic assignment, then just add an
>   // atomic qualification step.
>   if (const AtomicType *AtomicTy = dyn_cast<AtomicType>(LHSType)) {
>     AssignConvertType result =
>         CheckAssignmentConstraints(AtomicTy->getValueType(), RHS, Kind);
>     if (result != AssignConvertType::Compatible)
>       return result;
> ```

Thank you for the investigation, that's definitely it!

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


More information about the cfe-commits mailing list