From a1db7df243610bd5433c2147ecad9de76a1f7da4 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 31 Jul 2014 17:39:50 +0000 Subject: Obective-C. Patch to fix the incorrect ObjcMessageExpr argument source ranges, when arguments are structures or classes. PR16392. patch by Karlis Senko llvm-svn: 214409 --- clang/unittests/AST/SourceLocationTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/unittests/AST/SourceLocationTest.cpp') diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index 82bba64334b..ca5a8892a58 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -486,5 +486,17 @@ TEST(FriendDecl, InstantiationSourceRange) { friendDecl(hasParent(recordDecl(isTemplateInstantiation()))))); } +TEST(ObjCMessageExpr, CXXConstructExprRange) { + RangeVerifier Verifier; + Verifier.expectRange(5, 25, 5, 27); + EXPECT_TRUE(Verifier.match( + "struct A { int a; };\n" + "@interface B {}\n" + "+ (void) f1: (A)arg;\n" + "@end\n" + "void f2() { A a; [B f1: (a)]; }\n", + constructExpr(), Lang_OBJCXX)); +} + } // end namespace ast_matchers } // end namespace clang -- cgit v1.2.3