In C, assignment expressions result in an rvalue whose type is the type of the lhs of the assignment after it undergoes lvalue to rvalue conversion. lvalue to rvalue conversion in C strips all qualifiers including _Atomic.
We used getUnqualifiedType() which does not strip the _Atomic qualifier when we should have used getAtomicUnqualifiedType(). This corrects the usage and adds some comments to getUnqualifiedType() to make it more clear that it does not strip _Atomic and that's on purpose (see C11 6.2.5p27).
This addresses Issue 48742.
I wonder if we want another comment here to make it extra clear that atomic should be stripped?