]> granicus.if.org Git - clang/commitdiff
When naming a function template via a qualified-id (or any other way
authorDouglas Gregor <dgregor@apple.com>
Fri, 29 Jan 2010 17:15:43 +0000 (17:15 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 29 Jan 2010 17:15:43 +0000 (17:15 +0000)
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

lib/Sema/SemaExpr.cpp
test/SemaTemplate/qualified-id.cpp

index 5be017a754114ca22f296328c8ef8a7e883faae3..3b09a583cd2a0a2b700d1e8c046481c26a52860f 100644 (file)
@@ -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
index 655a80e2bfbfb92e6f0f7db363b4365aef1dcc55..2e3a826ce894264759b7a71c73b2db22e4329f38 100644 (file)
@@ -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);
+  }
+}