[clang][AST] Fix crash when printing error
authorEllis Hoag <ellis.sparky.hoag@gmail.com>
Mon, 3 Jan 2022 02:02:08 +0000 (18:02 -0800)
committerEllis Hoag <ellis.sparky.hoag@gmail.com>
Mon, 3 Jan 2022 02:03:42 +0000 (18:03 -0800)
commite27b5f9371382952eb5482ad151bb6fcb4cd0d7c
treeb55dc0c7d7d83ba6577d7b6088323f070b58cd90
parent1a0a177965e88d61b5d3cd3e7f7f89011f0827c1
[clang][AST] Fix crash when printing error

Clang will crash if it tries to compile the following code. This commit
fixes it.
```
$ cat foo.c
void foo(_Nullable int *ptr) {
    __auto_type _Nonnull a = ptr;
};
$ clang foo.c -c -Wnullable-to-nonnull-conversion
```

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D116342
clang/lib/AST/TypePrinter.cpp
clang/test/Sema/nullability.c