Test for source location range of new expressions fixed in r167507.
Patch by Philip Craig.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167538 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/AST/SourceLocationTest.cpp b/unittests/AST/SourceLocationTest.cpp
index 73415b5..7d6e0c3 100644
--- a/unittests/AST/SourceLocationTest.cpp
+++ b/unittests/AST/SourceLocationTest.cpp
@@ -248,5 +248,11 @@
EXPECT_TRUE(Verifier.match("void f(i) {}", varDecl(), Lang_C));
}
+TEST(CXXNewExpr, ArrayRange) {
+ RangeVerifier<CXXNewExpr> Verifier;
+ Verifier.expectRange(1, 12, 1, 22);
+ EXPECT_TRUE(Verifier.match("void f() { new int[10]; }", newExpr()));
+}
+
} // end namespace ast_matchers
} // end namespace clang