aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/AST/SourceLocationTest.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2022-01-08 00:12:18 +0100
committerHaojian Wu <hokein.wu@gmail.com>2022-01-10 12:46:27 +0100
commit55d96ac3dc56bdebea854952a724c2a50d96ce19 (patch)
treeab613943b3937a7952e6ab3dc81e39f60e88b4bf /clang/unittests/AST/SourceLocationTest.cpp
parentabe3003ead808518190d1e9717495735786938d3 (diff)
downloadllvm-55d96ac3dc56bdebea854952a724c2a50d96ce19.zip
llvm-55d96ac3dc56bdebea854952a724c2a50d96ce19.tar.gz
llvm-55d96ac3dc56bdebea854952a724c2a50d96ce19.tar.bz2
[AST] Add RParen loc for decltype AutoTypeloc.
Differential Revision: https://reviews.llvm.org/D116919
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..85f43ad 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_CXX11));
+}
+
TEST(TypeLoc, LongDoubleRange) {
RangeVerifier<TypeLoc> Verifier;
Verifier.expectRange(1, 1, 1, 6);