aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExpr.cpp2
-rw-r--r--test/SemaTemplate/qualified-id.cpp15
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 5be017a754..3b09a583cd 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1487,7 +1487,7 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
bool NeedsADL) {
// If this is a single, fully-resolved result and we don't need ADL,
// just build an ordinary singleton decl ref.
- if (!NeedsADL && R.isSingleResult())
+ if (!NeedsADL && R.isSingleResult() && !R.getAsSingle<FunctionTemplateDecl>())
return BuildDeclarationNameExpr(SS, R.getNameLoc(), R.getFoundDecl());
// We only need to check the declaration if there's exactly one
diff --git a/test/SemaTemplate/qualified-id.cpp b/test/SemaTemplate/qualified-id.cpp
index 655a80e2bf..2e3a826ce8 100644
--- a/test/SemaTemplate/qualified-id.cpp
+++ b/test/SemaTemplate/qualified-id.cpp
@@ -29,3 +29,18 @@ namespace test2 {
}
};
}
+
+namespace PR6063 {
+ template <typename T> void f(T, T);
+
+ namespace detail
+ {
+ using PR6063::f;
+ }
+
+ template <typename T>
+ void g(T a, T b)
+ {
+ detail::f(a, b);
+ }
+}