[clang] Do not crash on pointer wchar_t pointer assignment.
authorAdam Czachorowski <adamcz@google.com>
Tue, 17 Nov 2020 13:24:00 +0000 (14:24 +0100)
committerAdam Czachorowski <adamcz@google.com>
Fri, 20 Nov 2020 14:27:15 +0000 (15:27 +0100)
commit95ce9fbc235a467b84b2ffa2571f1d1a45af9427
tree201494ec412ad504294909e8fdf5cff8ee96ce20
parent412237dcd07e5a2afbb1767858262a5f037149a3
[clang] Do not crash on pointer wchar_t pointer assignment.

wchar_t can be signed (thus hasSignedIntegerRepresentation() returns
true), but it doesn't have an unsigned type, which would lead to a crash
when trying to get it.

With this fix, we special-case WideChar types in the pointer assignment
code.

Differential Revision: https://reviews.llvm.org/D91625
clang/lib/AST/ASTContext.cpp
clang/test/SemaCXX/wchar_t.cpp