From: Douglas Gregor Date: Fri, 29 Jan 2010 17:15:43 +0000 (+0000) Subject: When naming a function template via a qualified-id (or any other way X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86b8e0949869bb9a7af3a703e8756bad8621c9c5;p=clang 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 --- 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()) 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 void f(T, T); + + namespace detail + { + using PR6063::f; + } + + template + void g(T a, T b) + { + detail::f(a, b); + } +}