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 D91625
[clang] Do not crash on pointer wchar_t pointer assignment. adamcz on Nov 17 2020, 5:27 AM. Authored by
Details wchar_t can be signed (thus hasSignedIntegerRepresentation() returns With this fix, we special-case WideChar types in the pointer assignment
Diff Detail
Unit Tests
Event Timeline
Comment Actions addressed review comment
|
I'm wondering whether the fix is in ASTContext::getCorrespondingUnsignedType()
if my reading of the standard is right:
I think the rule also applies on wchar_t, the fix seems to handle WChar_S case (return ASTContext::getUnsignedWCharType()) in ASTContext::getCorrespondingUnsignedType(). What do you think?