summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/SourceLocationTest.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-02-22 02:59:41 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-02-22 02:59:41 +0000
commitb8d17e7a3b194414e071908004f81ee5fcf01b8d (patch)
treee64e0540c3c8d6a16d74153c3505abd07551740f /clang/unittests/AST/SourceLocationTest.cpp
parentbfec361caec215a7f6b6f313f553aa115646435a (diff)
downloadbcm5719-llvm-b8d17e7a3b194414e071908004f81ee5fcf01b8d.tar.gz
bcm5719-llvm-b8d17e7a3b194414e071908004f81ee5fcf01b8d.zip
Correctly set brace range for CXXConstructExprs formed by list initialization.
Differential Revision: http://llvm-reviews.chandlerc.com/D2711 llvm-svn: 201926
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r--clang/unittests/AST/SourceLocationTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp
index c08c2652b67..6e944429445 100644
--- a/clang/unittests/AST/SourceLocationTest.cpp
+++ b/clang/unittests/AST/SourceLocationTest.cpp
@@ -211,6 +211,16 @@ TEST(CXXFunctionalCastExpr, SourceRange) {
functionalCastExpr(), Lang_CXX11));
}
+TEST(CXXConstructExpr, SourceRange) {
+ RangeVerifier<CXXConstructExpr> Verifier;
+ Verifier.expectRange(3, 14, 3, 19);
+ EXPECT_TRUE(Verifier.match(
+ "struct A { A(int, int); };\n"
+ "void f(A a);\n"
+ "void g() { f({0, 0}); }",
+ constructExpr(), Lang_CXX11));
+}
+
TEST(CXXTemporaryObjectExpr, SourceRange) {
RangeVerifier<CXXTemporaryObjectExpr> Verifier;
Verifier.expectRange(2, 6, 2, 12);
OpenPOWER on IntegriCloud