[Syntax] Remove a strict valid source location assertion for TypeLoc.
authorHaojian Wu <hokein.wu@gmail.com>
Mon, 8 Feb 2021 14:04:48 +0000 (15:04 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Thu, 11 Feb 2021 08:53:52 +0000 (09:53 +0100)
commite159a3ced4c54b539c165b1cc26424fa0b34d53e
treee3929638044d9b4f3ccbce40881f95169bfd16c9
parent35a5e883906f11b63b60574d8737791448dd478f
[Syntax] Remove a strict valid source location assertion for TypeLoc.

The EndLoc of a type loc can be invalid for broken code.

Also extend the existing test to support error code with `error-ok`
annotation.

Differential Revision: https://reviews.llvm.org/D96261
clang/lib/Tooling/Syntax/BuildTree.cpp
clang/unittests/Tooling/Syntax/BuildTreeTest.cpp