[AST] Fix the incorrect auto-keyword loc for constrained auto type loc.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 19 Jan 2022 12:55:07 +0000 (13:55 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 19 Jan 2022 13:18:38 +0000 (14:18 +0100)
commit6c78703e3abcd9c76aefbf066869fe6a32d59516
treec4a883ade490ef80198b19891b3c2cc9b478e8ba
parent73cc8dd2d7d342de71063066b254b9c90c4f31ef
[AST] Fix the incorrect auto-keyword loc for constrained auto type loc.

E.g.  `Concept auto Func();`

The nameLoc for the constained auto type loc pointed to the concept name
loc, it should be the auto token loc. This patch fixes it, and remove
a relevant hack in clang-tidy check.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D117009
clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp
clang/lib/Parse/ParseDecl.cpp
clang/unittests/AST/SourceLocationTest.cpp