aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/AST/SourceLocationTest.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2022-01-10 15:19:05 +0100
committerHaojian Wu <hokein.wu@gmail.com>2022-01-11 12:06:18 +0100
commit41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3 (patch)
treefdeb27c9cd7959a14c8f3b98b90299a01cbbcba4 /clang/unittests/AST/SourceLocationTest.cpp
parent0b48d0fe1292929f0cd61a2ca8114d794e245daa (diff)
downloadllvm-41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3.zip
llvm-41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3.tar.gz
llvm-41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3.tar.bz2
Reland "[AST] Add RParen loc for decltype AutoTypeloc."
Reland 55d96ac and 37ec65e with a clang-tidy fix.
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r--clang/unittests/AST/SourceLocationTest.cpp7
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);