summaryrefslogtreecommitdiff
path: root/unittests/AST
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
commitc7ecd63edfc41546d1c6b18f4e0b9bc7c7f7c408 (patch)
tree4a40de7cf4dd8158333fef2113516dc061156062 /unittests/AST
parent269a49b49b95f84fe4c48850c226a1a03e684772 (diff)
downloadclang-c7ecd63edfc41546d1c6b18f4e0b9bc7c7f7c408.tar.gz
clang-c7ecd63edfc41546d1c6b18f4e0b9bc7c7f7c408.tar.bz2
clang-c7ecd63edfc41546d1c6b18f4e0b9bc7c7f7c408.tar.xz
Correctly set brace range for CXXConstructExprs formed by list initialization.
Differential Revision: http://llvm-reviews.chandlerc.com/D2711 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/AST')
-rw-r--r--unittests/AST/SourceLocationTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/AST/SourceLocationTest.cpp b/unittests/AST/SourceLocationTest.cpp
index c08c2652b6..6e94442944 100644
--- a/unittests/AST/SourceLocationTest.cpp
+++ b/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);