From b8d17e7a3b194414e071908004f81ee5fcf01b8d Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 22 Feb 2014 02:59:41 +0000 Subject: Correctly set brace range for CXXConstructExprs formed by list initialization. Differential Revision: http://llvm-reviews.chandlerc.com/D2711 llvm-svn: 201926 --- clang/unittests/AST/SourceLocationTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/unittests/AST/SourceLocationTest.cpp') 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 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 Verifier; Verifier.expectRange(2, 6, 2, 12); -- cgit v1.2.3