diff options
author | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-07-07 06:41:54 +0000 |
---|---|---|
committer | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-07-07 06:41:54 +0000 |
commit | 8421a06314356a7e53819f9e13242bb5fb962141 (patch) | |
tree | 78868d857fa7c8642798dfa5dd0ea9a2f463b8e1 /clang/unittests/AST/SourceLocationTest.cpp | |
parent | 7a22921e5a2494b7929431b9816d97d361a39ea7 (diff) | |
download | bcm5719-llvm-8421a06314356a7e53819f9e13242bb5fb962141.tar.gz bcm5719-llvm-8421a06314356a7e53819f9e13242bb5fb962141.zip |
Fixed source range for functional cast and unresolved construct expr nodes.
Added testcases.
llvm-svn: 185773
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r-- | clang/unittests/AST/SourceLocationTest.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index be63085b8a5..697c6a04b75 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -201,5 +201,26 @@ TEST(UnaryTransformTypeLoc, ParensRange) { loc(unaryTransformType()))); } +TEST(CXXFunctionalCastExpr, SourceRange) { + RangeVerifier<CXXFunctionalCastExpr> Verifier; + Verifier.expectRange(2, 10, 2, 14); + EXPECT_TRUE(Verifier.match( + "int foo() {\n" + " return int{};\n" + "}", + functionalCastExpr(), Lang_CXX11)); +} + +TEST(CXXUnresolvedConstructExpr, SourceRange) { + RangeVerifier<CXXUnresolvedConstructExpr> Verifier; + Verifier.expectRange(3, 10, 3, 12); + EXPECT_TRUE(Verifier.match( + "template <typename U>\n" + "U foo() {\n" + " return U{};\n" + "}", + unresolvedConstructExpr(), Lang_CXX11)); +} + } // end namespace ast_matchers } // end namespace clang |