diff options
author | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-09-07 05:49:53 +0000 |
---|---|---|
committer | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-09-07 05:49:53 +0000 |
commit | 76e98feb578c0cba1500554227699dafd9afe600 (patch) | |
tree | 4dedb9b13dd27f33c15fe0b58268f0da25270cf1 /clang/unittests/AST/SourceLocationTest.cpp | |
parent | d87fc157d2b791af191de89d460c8cae124b47a8 (diff) | |
download | bcm5719-llvm-76e98feb578c0cba1500554227699dafd9afe600.tar.gz bcm5719-llvm-76e98feb578c0cba1500554227699dafd9afe600.zip |
Fix missing source location in CXXTemporaryObjectExpr nodes.
For clarity, renamed (get/set)ParenRange as (get/set)ParenOrBraceRange
in CXXConstructExpr nodes.
Added testcase.
llvm-svn: 190239
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r-- | clang/unittests/AST/SourceLocationTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index d45c6448c79..29156bc96ba 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -211,6 +211,15 @@ TEST(CXXFunctionalCastExpr, SourceRange) { functionalCastExpr(), Lang_CXX11)); } +TEST(CXXTemporaryObjectExpr, SourceRange) { + RangeVerifier<CXXTemporaryObjectExpr> Verifier; + Verifier.expectRange(2, 6, 2, 12); + EXPECT_TRUE(Verifier.match( + "struct A { A(int, int); };\n" + "A a( A{0, 0} );", + temporaryObjectExpr(), Lang_CXX11)); +} + TEST(CXXUnresolvedConstructExpr, SourceRange) { RangeVerifier<CXXUnresolvedConstructExpr> Verifier; Verifier.expectRange(3, 10, 3, 12); |