aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-29 17:15:43 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-29 17:15:43 +0000
commit86b8e0949869bb9a7af3a703e8756bad8621c9c5 (patch)
treeba8002b7ee1b3adba69b5dc256771d900c2cccaf
parent3239a67361cc89eba2fe7c7abdb41bd2c9414207 (diff)
When naming a function template via a qualified-id (or any other way
that ADL is suppressed), we need to build an UnresolvedLookupExpr. Fixes PR6063, which was hitting Boost headers pretty hard. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94814 91177308-0d34-0410-b5e6-96231b3b80d8
-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);
+ }
+}