diff options
author | Haojian Wu <hokein.wu@gmail.com> | 2022-01-14 11:28:04 +0100 |
---|---|---|
committer | Haojian Wu <hokein.wu@gmail.com> | 2022-01-17 11:33:11 +0100 |
commit | ab3f100bec03d72ecee947a323c51698d4b95207 (patch) | |
tree | bbc9ccf0faeaea37571285861f79d048740465bd /clang/unittests/AST/SourceLocationTest.cpp | |
parent | 2325f363010d3176e96579628cbb96b8fca003a1 (diff) | |
download | llvm-ab3f100bec03d72ecee947a323c51698d4b95207.zip llvm-ab3f100bec03d72ecee947a323c51698d4b95207.tar.gz llvm-ab3f100bec03d72ecee947a323c51698d4b95207.tar.bz2 |
Reland (2) "[AST] Add RParen loc for decltype AutoTypeloc.""
The patch was reverted because it caused a crash during PCH build -- we
missed to update the RParenLoc in TreeTransform<Derived>::TransformAutoType.
This relands 55d96ac and 37ec65e with a test and fix.
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r-- | clang/unittests/AST/SourceLocationTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index 832d375..a798f6b 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -242,6 +242,13 @@ TEST(TypeLoc, DecltypeTypeLocRange) { verify(Target2->getSourceRange(), Code.range("full2")); } +TEST(TypeLoc, AutoTypeLocRange) { + RangeVerifier<TypeLoc> Verifier; + Verifier.expectRange(1, 1, 1, 14); + EXPECT_TRUE(Verifier.match("decltype(auto) a = 1;", typeLoc(loc(autoType())), + Lang_CXX14)); +} + TEST(TypeLoc, LongDoubleRange) { RangeVerifier<TypeLoc> Verifier; Verifier.expectRange(1, 1, 1, 6); |