Introduce support for constructor templates, which can now be declared
and will participate in overload resolution. Unify the instantiation
of CXXMethodDecls and CXXConstructorDecls, which had already gotten
out-of-sync.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79658 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index b126a09..5c0bbec 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -712,6 +712,18 @@
   return new (C) OverloadedFunctionDecl(DC, N);
 }
 
+OverloadIterator::OverloadIterator(NamedDecl *ND) : D(0) {
+  if (!ND)
+    return;
+  
+  if (isa<FunctionDecl>(ND) || isa<FunctionTemplateDecl>(ND))
+    D = ND;
+  else if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(ND)) {
+    D = ND;
+    Iter = Ovl->function_begin();
+  }
+}
+
 void OverloadedFunctionDecl::addOverload(AnyFunctionDecl F) {
   Functions.push_back(F);
   this->setLocation(F.get()->getLocation());