Clang should not warn for:
test.c:2:12: warning: indirection of non-volatile null pointer will be deleted,
not trap [-Wnull-dereference] return *(int __attribute__((address_space(256))) *) 0; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Solves PR42292.
If I were to guess what would cause the segfault, I'd probably think it was the getPointeeType().getAddressSpace() in the event the type isn't actually a pointer.