aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-14 23:20:53 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-14 23:20:53 +0000
commit66a8c9a6b1f9bcd78779e5d414f3c9ae3cabdd93 (patch)
treec03fde61c60512ac96fb9685ba84442a3c68642a
parentec1b1cc006cef19e0a95d0ea6fbfd37d0d615066 (diff)
When determining whether an overload set with explicit template
arguments only resolves to a single specialization, make sure to look through using declarations. Fixes PR7641. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108376 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaOverload.cpp3
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp20
2 files changed, 22 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 975ad0bfd4..c4ab9061b4 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -6287,7 +6287,8 @@ FunctionDecl *Sema::ResolveSingleFunctionTemplateSpecialization(Expr *From) {
// specified and it, along with any default template arguments,
// identifies a single function template specialization, then the
// template-id is an lvalue for the function template specialization.
- FunctionTemplateDecl *FunctionTemplate = cast<FunctionTemplateDecl>(*I);
+ FunctionTemplateDecl *FunctionTemplate
+ = cast<FunctionTemplateDecl>((*I)->getUnderlyingDecl());
// C++ [over.over]p2:
// If the name is a function template, template argument deduction is
diff --git a/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp b/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
index dc79300af3..5556f35dbf 100644
--- a/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
+++ b/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp
@@ -43,3 +43,23 @@ namespace PR5949 {
return Foo<T>(b, quuz);
}
}
+
+// PR7641
+namespace PR7641 {
+ namespace N2
+ {
+ template<class>
+ int f0(int);
+ }
+ namespace N
+ {
+ using N2::f0;
+ }
+
+ template<class R,class B1>
+ int
+ f1(R(a)(B1));
+
+ void f2()
+ { f1(N::f0<int>); }
+}