Add support for overloaded matchers. ie different matcher function signatures with the same name.

Summary:
Add support for overloaded matchers.
This composes with other features, like supporting polymorphic matchers.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1188

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186836 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/ASTMatchers/Dynamic/ParserTest.cpp b/unittests/ASTMatchers/Dynamic/ParserTest.cpp
index 9ccd3dc..d9b2d3c 100644
--- a/unittests/ASTMatchers/Dynamic/ParserTest.cpp
+++ b/unittests/ASTMatchers/Dynamic/ParserTest.cpp
@@ -256,6 +256,15 @@
             ParseMatcherWithError("hasBody(stmt())"));
 }
 
+TEST(ParserTest, OverloadErrors) {
+  EXPECT_EQ("1:1: Error building matcher callee.\n"
+            "1:8: Candidate 1: Incorrect type for arg 1. "
+            "(Expected = Matcher<Stmt>) != (Actual = String)\n"
+            "1:8: Candidate 2: Incorrect type for arg 1. "
+            "(Expected = Matcher<Decl>) != (Actual = String)",
+            ParseWithError("callee(\"A\")"));
+}
+
 }  // end anonymous namespace
 }  // end namespace dynamic
 }  // end namespace ast_matchers